From f07fcac13dd91e34a32dc99430eb5b33db68c6e4 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Sun, 19 May 2019 08:38:03 +0200 Subject: [PATCH] If MNTP is configured to pick max 1 item, don't allow multiselect in the content picker dialog --- .../contentpicker/contentpicker.controller.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 33cf24962f..4d695c97b5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -157,6 +157,11 @@ function contentPickerController($scope, entityResource, editorState, iconHelper // pre-value config on to the dialog options angular.extend(dialogOptions, $scope.model.config); + // if we can't pick more than one item, explicitly disable multiPicker in the dialog options + if ($scope.model.config.maxNumber && parseInt($scope.model.config.maxNumber) === 1) { + dialogOptions.multiPicker = false; + } + // add the current filter (if any) as title for the filtered out nodes if ($scope.model.config.filter) { localizationService.localize("contentPicker_allowedItemTypes", [$scope.model.config.filter]).then(function (data) {