tree sync actually works now
This commit is contained in:
@@ -150,19 +150,20 @@ angular.module("umbraco.directives")
|
||||
|
||||
//watch for path changes
|
||||
scope.$watch("path", function (newVal, oldVal) {
|
||||
if(!scope.tree || newVal){
|
||||
loadTree();
|
||||
|
||||
//resetting the path destroys the tree
|
||||
if(newVal && newVal !== oldVal){
|
||||
scope.tree = null;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//watch for active tree changes
|
||||
scope.$watch("activetree", function (newVal, oldVal) {
|
||||
|
||||
if(!scope.tree){
|
||||
loadTree();
|
||||
}else if (newVal && newVal !== oldVal) {
|
||||
if (newVal && newVal !== oldVal) {
|
||||
scope.tree = null;
|
||||
//only reload the tree data and Dom if the newval is different from the old one
|
||||
loadTree();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -176,6 +177,11 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
});
|
||||
|
||||
//When a section is double clicked
|
||||
scope.$on("tree.clearCache", function (evt, data) {
|
||||
treeService.clearCache(data.tree);
|
||||
scope.tree = null;
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -140,10 +140,6 @@ angular.module("umbraco.directives")
|
||||
scope.loadChildren(null, scope.node, true);
|
||||
}else if( !node.metaData.treeAlias && activePath.indexOf(node.id) >= 0){
|
||||
scope.loadChildren(null, scope.node, true);
|
||||
|
||||
scope.path = activePath.filter( function(element) {
|
||||
return listToDelete.indexOf(obj.id) === -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user