tree syncing
This commit is contained in:
@@ -123,8 +123,7 @@ angular.module("umbraco.directives")
|
||||
|
||||
//watch for section changes
|
||||
scope.$watch("section", function (newVal, oldVal) {
|
||||
|
||||
if(!scope.tree){
|
||||
if(!scope.tree){
|
||||
loadTree();
|
||||
}
|
||||
|
||||
@@ -141,6 +140,18 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
});
|
||||
|
||||
//watch for path changes
|
||||
scope.$watch("path", function (newVal, oldVal) {
|
||||
|
||||
if(!scope.tree){
|
||||
loadTree();
|
||||
}
|
||||
if (newVal && newVal !== oldVal) {
|
||||
//only reload the tree data and Dom if the newval is different from the old one
|
||||
loadTree();
|
||||
}
|
||||
});
|
||||
|
||||
//watch for active tree changes
|
||||
scope.$watch("activetree", function (newVal, oldVal) {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @description
|
||||
* The controller for the content editor
|
||||
*/
|
||||
function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService) {
|
||||
function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService) {
|
||||
|
||||
//initialize the file manager
|
||||
fileManager.clearFiles();
|
||||
@@ -49,6 +49,8 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
newContent: data,
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -73,6 +75,8 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
|
||||
}, function (err) {
|
||||
|
||||
contentEditingHelper.handleSaveError({
|
||||
@@ -124,8 +128,9 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
deferred.resolve(data);
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
|
||||
deferred.resolve(data);
|
||||
}, function (err) {
|
||||
contentEditingHelper.handleSaveError({
|
||||
err: err,
|
||||
|
||||
Reference in New Issue
Block a user