fixes mntp filtering

This commit is contained in:
perploug
2014-01-24 18:38:47 +01:00
parent d842f0f5b7
commit 3e22598f4a
2 changed files with 9 additions and 6 deletions

View File

@@ -235,8 +235,9 @@ function umbTreeDirective($compile, $log, $q, $rootScope, treeService, notificat
//set the root as the current active tree
scope.activeTree = scope.tree.root;
emitEvent("treeLoaded", { tree: scope.tree.root });
emitEvent("treeLoaded", { tree: scope.tree });
emitEvent("treeNodeExpanded", { tree: scope.tree, node: scope.tree.root, children: scope.tree.root.children });
}, function(reason) {
scope.loading = false;
notificationsService.error("Tree Error", reason);

View File

@@ -40,11 +40,11 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
//Configures filtering
if (dialogOptions.filter) {
dialogOptions.filterExclude = true;
dialogOptions.filterExclude = false;
dialogOptions.filterAdvanced = false;
if(dialogOptions.filter[0] === "!"){
dialogOptions.filterExclude = false;
dialogOptions.filterExclude = true;
dialogOptions.filter = dialogOptions.filter.substring(1);
}
@@ -112,8 +112,10 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
angular.forEach(nodes, function (value, key) {
var found = a.indexOf(value.metaData.contentType) >= 0;
if ((dialogOptions.filterExclude && found) || !found) {
value.filtered = true;
if (!dialogOptions.filterExclude && !found || dialogOptions.filterExclude && found){
value.filtered = true;
if(dialogOptions.filterCssClass){
value.cssClasses.push(dialogOptions.filterCssClass);
}