V8: Filter out invalid selections in the MNTP "Allowed items" picker (#6641)

This commit is contained in:
Kenn Jacobsen
2019-10-24 17:21:38 +02:00
committed by Sebastiaan Janssen
parent f2dfdd6086
commit b0d7bdaa77
2 changed files with 14 additions and 1 deletions

View File

@@ -42,6 +42,11 @@ function TreeSourceTypePickerController($scope, contentTypeResource, mediaTypeRe
var editor = {
multiPicker: true,
filterCssClass: "not-allowed not-published",
filter: function (item) {
// filter out folders (containers), element types (for content) and already selected items
return item.nodeType === "container" || item.metaData.isElement || !!_.findWhere(vm.itemTypes, { udi: item.udi });
},
submit: function (model) {
var newItemTypes = _.map(model.selection,
function(selected) {