From c7ea93199f59f3ef64201f17fd347e5ba8434b6f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 5 Sep 2019 16:45:33 +0200 Subject: [PATCH] Merge pull request #6222 from patrickdemooij9/temp-5724 5724: Unable to add multiple property groups (cherry picked from commit 3163b5f2fe5b81f716e3330d0662856ae88dba5c) # Conflicts: # src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js --- .../components/umbgroupsbuilder.directive.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js index c60d6aebdd..5d654da813 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js @@ -384,6 +384,8 @@ // activate group scope.activateGroup(group); + // push new init tab to the scope + addInitGroup(scope.model.groups); }; scope.activateGroup = function(selectedGroup) { @@ -402,7 +404,6 @@ scope.removeGroup = function(groupIndex) { scope.model.groups.splice(groupIndex, 1); - addInitGroup(scope.model.groups); }; scope.updateGroupTitle = function(group) { @@ -531,10 +532,8 @@ // set focus on init property var numberOfProperties = group.properties.length; group.properties[numberOfProperties - 1].focus = true; - - // push new init tab to the scope - addInitGroup(scope.model.groups); + notifyChanged(); }, close: function() { if(_.isEqual(oldPropertyModel, propertyModel) === false) { @@ -580,17 +579,7 @@ // remove property tab.properties.splice(propertyIndex, 1); - // if the last property in group is an placeholder - remove add new tab placeholder - if(tab.properties.length === 1 && tab.properties[0].propertyState === "init") { - - angular.forEach(scope.model.groups, function(group, index, groups){ - if(group.tabState === 'init') { - groups.splice(index, 1); - } - }); - - } - + notifyChanged(); }; function addInitProperty(group) {