mirror of
https://github.com/ONLYOFFICE/sdkjs-forms.git
synced 2026-02-10 18:05:42 +08:00
[oform] Check for unused fields at the end of the action
This commit is contained in:
@ -479,6 +479,15 @@
|
||||
this.removeFieldMasterByIndex(fieldIndex);
|
||||
}
|
||||
};
|
||||
CDocument.prototype.removeUnusedFieldMasters = function()
|
||||
{
|
||||
for (let fieldIndex = this.FieldMasters.length - 1; fieldIndex >= 0; --fieldIndex)
|
||||
{
|
||||
let fieldMaster = this.FieldMasters[fieldIndex];
|
||||
if (!fieldMaster.isUseInDocument())
|
||||
this.removeFieldMasterByIndex(fieldIndex);
|
||||
}
|
||||
};
|
||||
|
||||
//--------------------------------------------------------export----------------------------------------------------
|
||||
AscOForm.CDocument = CDocument;
|
||||
|
||||
@ -475,6 +475,10 @@
|
||||
|
||||
api.sendEvent("asc_onUpdateOFormRoles", this.Roles);
|
||||
};
|
||||
OForm.prototype.onEndAction = function()
|
||||
{
|
||||
this.Format.removeUnusedFieldMasters();
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private area
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user