diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 1320bd6804..64363914f9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -104,9 +104,6 @@ vm.minItems = model.config.minItems || 0; vm.maxItems = model.config.maxItems || 0; - if (vm.maxItems === 0) - vm.maxItems = 1000; - vm.singleMode = vm.minItems === 1 && vm.maxItems === 1 && model.config.contentTypes.length === 1; vm.expandsOnLoad = Object.toBoolean(model.config.expandsOnLoad) vm.showIcons = Object.toBoolean(model.config.showIcons); @@ -204,9 +201,17 @@ validate(); }; + vm.maxItemsExceeded = function () { + return vm.maxItems !== 0 && vm.nodes.length > vm.maxItems; + } + + vm.maxItemsReached = function () { + return vm.maxItems !== 0 && vm.nodes.length >= vm.maxItems; + } + vm.openNodeTypePicker = function ($event) { - if (vm.nodes.length >= vm.maxItems) { + if (vm.maxItemsReached()) { return; } @@ -767,7 +772,7 @@ $scope.nestedContentForm.minCount.$setValidity("minCount", true); } - if (vm.nodes.length > vm.maxItems) { + if (vm.maxItemsExceeded()) { $scope.nestedContentForm.maxCount.$setValidity("maxCount", false); } else { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html index f2654e9851..e5f4564e08 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.propertyeditor.html @@ -1,4 +1,4 @@ -
+
@@ -60,9 +60,9 @@ @@ -78,7 +78,7 @@ Minimum %0% entries, needs %1% more.
-
+
Maximum %0% entries, %1% too many.