Merge pull request #7344 from kjac/v8/fix/mntp-start-node-and-filter

V8: Display MNTP "Allow items of type" correctly when a start node is set
This commit is contained in:
Poornima Nayar
2019-12-27 13:58:50 +00:00
committed by GitHub
2 changed files with 10 additions and 11 deletions

View File

@@ -19,15 +19,16 @@ angular.module('umbraco')
};
}
if($scope.model.value.id && $scope.model.value.type !== "member"){
entityResource.getById($scope.model.value.id, entityType()).then(function(item){
if($scope.model.value.id && $scope.model.value.type !== "member"){
entityResource.getById($scope.model.value.id, entityType()).then(function(item){
populate(item);
});
});
}
else {
$timeout(function () {
treeSourceChanged();
}, 100);
}
$timeout(function () {
treeSourceChanged();
}, 100);
function entityType() {
var ent = "Document";

View File

@@ -7,7 +7,6 @@ function TreeSourceTypePickerController($scope, contentTypeResource, mediaTypeRe
var allItemTypes = null;
var currentItemType = null;
var initialLoad = true;
function init() {
vm.loading = true;
@@ -86,13 +85,12 @@ function TreeSourceTypePickerController($scope, contentTypeResource, mediaTypeRe
}
eventsService.on("treeSourceChanged", function (e, args) {
currentItemType = args.value;
// reset the model value if we changed node type (but not on the initial load)
if (!initialLoad) {
if (!!currentItemType && currentItemType !== args.value) {
vm.itemTypes = [];
updateModel();
}
initialLoad = false;
currentItemType = args.value;
init();
});
}