Merge pull request #5491 from kjac/v8-feature-mntp-single-mode-improvements

V8: MNTP improvements when configured to select only one item
This commit is contained in:
Sebastiaan Janssen
2019-05-31 20:47:41 +02:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@@ -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) {