From 848d25a1561d331e26d644d16ce04c2d51558107 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Tue, 29 Apr 2014 19:52:23 -0600 Subject: [PATCH 1/2] Show "remove" button when MaxFieldsets = 1 and Multiple Fieldset Types ... so the user can switch types (remove/add) when only a single row. We check for Multiple Fieldset Types as well, because we don't want to show a "remove" button when there's only one type allowed (presumably). --- app/controllers/controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/controller.js b/app/controllers/controller.js index 606a319..8358be1 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -93,7 +93,8 @@ //helper that returns if an item can be removed $scope.canRemove = function () { - return countVisible() > 1 + return countVisible() > 1 + || ($scope.model.config.maxFieldsets == 1 && $scope.model.config.fieldsets.length > 1) || $scope.model.config.startWithAddButton; } From 6ea44c271d296a63ac99e2a23870285bc33bb531 Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 30 Apr 2014 10:00:15 -0400 Subject: [PATCH 2/2] Use a count on the add button rather than checking flag --- app/controllers/controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/controller.js b/app/controllers/controller.js index 8358be1..3f31ac3 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -108,7 +108,7 @@ $scope.showAddButton = function () { return $scope.model.config.startWithAddButton && countVisible() === 0 - && !$scope.model.config.enableMultipleFieldsets; + && $scope.model.config.fieldsets.length == 1; } //helper, ini the render model from the server (model.value)