From 0be878b888d70806f8a0538ffee792ac26a24095 Mon Sep 17 00:00:00 2001 From: KirillovIlya Date: Wed, 7 Dec 2022 12:04:32 +0300 Subject: [PATCH] [oform] Add a method to clear the list of users in the field master --- oform/FieldMaster.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/oform/FieldMaster.js b/oform/FieldMaster.js index be43a61..00f3793 100644 --- a/oform/FieldMaster.js +++ b/oform/FieldMaster.js @@ -104,6 +104,13 @@ AscCommon.History.Add(new AscDFH.CChangesOFormFieldMasterAddRemoveUser(this, user.GetId(), false)); this.Users.splice(index, 1); }; + CFieldMaster.prototype.clearUsers = function() + { + while (this.Users.length) + { + this.removeUser(this.Users[this.Users.length - 1]); + } + }; CFieldMaster.prototype.getUserCount = function() { return this.Users.length; @@ -144,7 +151,6 @@ }; CFieldMaster.prototype.isUseInDocument = function() { - return true; return (this.Field && this.Field.IsUseInDocument() && this === this.Field.GetFieldMaster());