mirror of
https://github.com/ONLYOFFICE/sdkjs-forms.git
synced 2026-03-31 10:23:35 +08:00
[de] Don't return complex form if it is a labeled checkbox
This commit is contained in:
10
api.js
10
api.js
@ -80,7 +80,7 @@ window["AscOForm"] = window.AscOForm = AscOForm;
|
|||||||
AscFonts.FontPickerByCharacter.getFontBySymbol(nUncheckedSymbol);
|
AscFonts.FontPickerByCharacter.getFontBySymbol(nUncheckedSymbol);
|
||||||
}
|
}
|
||||||
|
|
||||||
function private_ApplyPrToCheckBox(oCC)
|
function private_ApplyPrToCheckBox(oCC, checkBoxPr)
|
||||||
{
|
{
|
||||||
if (!oCC)
|
if (!oCC)
|
||||||
return;
|
return;
|
||||||
@ -128,7 +128,7 @@ window["AscOForm"] = window.AscOForm = AscOForm;
|
|||||||
for (let nIndex = 0, nCount = arrSelectedParagraphs.length; nIndex < nCount; ++nIndex)
|
for (let nIndex = 0, nCount = arrSelectedParagraphs.length; nIndex < nCount; ++nIndex)
|
||||||
{
|
{
|
||||||
let oCC = arrSelectedParagraphs[nIndex].AddCheckBoxToStartPos(oPr);
|
let oCC = arrSelectedParagraphs[nIndex].AddCheckBoxToStartPos(oPr);
|
||||||
private_ApplyPrToCheckBox(oCC);
|
private_ApplyPrToCheckBox(oCC, oPr);
|
||||||
}
|
}
|
||||||
|
|
||||||
oLogicDocument.LoadDocumentState(oState);
|
oLogicDocument.LoadDocumentState(oState);
|
||||||
@ -149,7 +149,7 @@ window["AscOForm"] = window.AscOForm = AscOForm;
|
|||||||
oLogicDocument.StartAction(AscDFH.historydescription_Document_AddContentControlCheckBox);
|
oLogicDocument.StartAction(AscDFH.historydescription_Document_AddContentControlCheckBox);
|
||||||
|
|
||||||
var oCC = oLogicDocument.AddContentControlCheckBox(oPr);
|
var oCC = oLogicDocument.AddContentControlCheckBox(oPr);
|
||||||
private_ApplyPrToCheckBox(oCC);
|
private_ApplyPrToCheckBox(oCC, oPr);
|
||||||
|
|
||||||
oLogicDocument.UpdateInterface();
|
oLogicDocument.UpdateInterface();
|
||||||
oLogicDocument.Recalculate();
|
oLogicDocument.Recalculate();
|
||||||
@ -464,8 +464,10 @@ window["AscOForm"] = window.AscOForm = AscOForm;
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
let mainForm = form.GetMainForm();
|
let mainForm = form.GetMainForm();
|
||||||
|
if (!mainForm || !mainForm.IsComplexForm() || mainForm.IsLabeledCheckBox())
|
||||||
|
return null;
|
||||||
|
|
||||||
return (mainForm.IsComplexForm() ? mainForm : null);
|
return mainForm;
|
||||||
};
|
};
|
||||||
window['Asc']['asc_docs_api'].prototype['asc_ConvertFormToJson'] = window['Asc']['asc_docs_api'].prototype.asc_ConvertFormToJson = function(form)
|
window['Asc']['asc_docs_api'].prototype['asc_ConvertFormToJson'] = window['Asc']['asc_docs_api'].prototype.asc_ConvertFormToJson = function(form)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user