mirror of
https://github.com/ONLYOFFICE/sdkjs-forms.git
synced 2026-03-31 10:23:35 +08:00
[de] Change interface for adding text form
This commit is contained in:
committed by
Ilya Kirillov
parent
4c4813f799
commit
af97f3085d
20
api.js
20
api.js
@ -304,21 +304,31 @@
|
|||||||
oLogicDocument.FinalizeAction();
|
oLogicDocument.FinalizeAction();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
window['Asc']['asc_docs_api'].prototype['asc_AddContentControlTextForm'] = window['Asc']['asc_docs_api'].prototype.asc_AddContentControlTextForm = function(oPr, oFormPr)
|
window['Asc']['asc_docs_api'].prototype['asc_AddContentControlTextForm'] = window['Asc']['asc_docs_api'].prototype.asc_AddContentControlTextForm = function(contentControlPr)
|
||||||
{
|
{
|
||||||
var oLogicDocument = this.private_GetLogicDocument();
|
var oLogicDocument = this.private_GetLogicDocument();
|
||||||
if (!oLogicDocument)
|
if (!oLogicDocument)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
let textFormPr = contentControlPr ? contentControlPr.TextFormPr : null;
|
||||||
|
let formPr = contentControlPr ? contentControlPr.FormPr : null;
|
||||||
|
let placeholderText = contentControlPr ? contentControlPr.PlaceholderText : "";
|
||||||
|
|
||||||
if (!oLogicDocument.IsSelectionLocked(AscCommon.changestype_Paragraph_Content))
|
if (!oLogicDocument.IsSelectionLocked(AscCommon.changestype_Paragraph_Content))
|
||||||
{
|
{
|
||||||
oLogicDocument.StartAction(AscDFH.historydescription_Document_AddContentControlTextForm);
|
oLogicDocument.StartAction(AscDFH.historydescription_Document_AddContentControlTextForm);
|
||||||
|
|
||||||
var oCC = oLogicDocument.AddContentControlTextForm(oPr);
|
var oCC = oLogicDocument.AddContentControlTextForm(textFormPr);
|
||||||
if (oCC && oFormPr)
|
if (oCC)
|
||||||
{
|
{
|
||||||
oCC.SetFormPr(oFormPr);
|
if (placeholderText)
|
||||||
oCC.UpdatePlaceHolderTextPrForForm();
|
oCC.SetPlaceholderText(placeholderText);
|
||||||
|
|
||||||
|
if (formPr)
|
||||||
|
{
|
||||||
|
oCC.SetFormPr(formPr);
|
||||||
|
oCC.UpdatePlaceHolderTextPrForForm();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oLogicDocument.UpdateInterface();
|
oLogicDocument.UpdateInterface();
|
||||||
|
|||||||
Reference in New Issue
Block a user