From 14bb7c4042a82284ca34c704c264056f84ab951f Mon Sep 17 00:00:00 2001 From: KirillovIlya Date: Mon, 28 Nov 2022 15:03:09 +0300 Subject: [PATCH] [oform] Fix weight when add a field group --- oform/Document.js | 2 +- oform/OForm.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/oform/Document.js b/oform/Document.js index 1258f32..ec13f0e 100644 --- a/oform/Document.js +++ b/oform/Document.js @@ -372,7 +372,7 @@ for (let index = 0, count = this.FieldGroups.length; index < count; ++index) { let curWeight = this.FieldGroups[index].getWeight(); - if (max > curWeight) + if (max < curWeight) max = curWeight; } diff --git a/oform/OForm.js b/oform/OForm.js index f5f9fa1..e984075 100644 --- a/oform/OForm.js +++ b/oform/OForm.js @@ -241,6 +241,7 @@ // Нельзя, чтобы групп не было вообще let defaultGroup = new AscOForm.CFieldGroup(); + defaultGroup.setWeight(this.Format.getMaxWeight() + 1); this.Format.addFieldGroup(defaultGroup); defaultGroup.addUser(this.Format.getDefaultUser()); };