Gets the tree reloading when the customtreeparams change too so now the language selection will auto trigger the tree to reload ... next task we'll make it re-sycn and work.

This commit is contained in:
Shannon
2018-04-12 21:56:49 +10:00
parent fddea8c815
commit f903c42d1b
3 changed files with 16 additions and 5 deletions

View File

@@ -420,8 +420,8 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat
emitEvent("treeNodeAltSelect", { element: elem, tree: scope.tree, node: n, event: ev });
};
//watch for section changes
scope.$watch("section", function (newVal, oldVal) {
//watch for section changes and customtreeparams changes
scope.$watchCollection("[section, customtreeparams]", function (newVal, oldVal) {
if (!scope.tree) {
loadTree();
@@ -440,7 +440,7 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat
//clear any active trees to reset lookups
lastSection = newVal;
}
});
});
setupExternalEvents();
loadTree();

View File

@@ -170,7 +170,16 @@ angular.module("umbraco").controller("Umbraco.Overlays.TreePickerController",
queryParams["languageId"] = vm.selectedLanguage.id;
}
var queryString = $.param(queryParams); //create the query string from the params object
vm.customTreeParams = queryString + (queryString ? "&" : "") + ($scope.model.customTreeParams ? $scope.model.customTreeParams : "");
if (!queryString) {
vm.customTreeParams = $scope.model.customTreeParams;
}
else {
vm.customTreeParams = queryString;
if ($scope.model.customTreeParams) {
vm.customTreeParams += "&" + $scope.model.customTreeParams;
}
}
vm.treeReady = true;
}

View File

@@ -135,7 +135,9 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
},
treeAlias: $scope.model.config.startNode.type,
section: $scope.model.config.startNode.type,
idType: "int"
idType: "int",
//only show the lang selector for content
showLanguageSelector: $scope.model.config.startNode.type === "content"
};
//since most of the pre-value config's are used in the dialog options (i.e. maxNumber, minNumber, etc...) we'll merge the