[de] Change interface for adding text form

This commit is contained in:
KirillovIlya
2022-09-01 16:39:11 +03:00
committed by Ilya Kirillov
parent 4c4813f799
commit af97f3085d

20
api.js
View File

@ -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();