diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/umboptionsmenu.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/umboptionsmenu.directive.js index 3629199bde..618f19b50e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/umboptionsmenu.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/umboptionsmenu.directive.js @@ -23,6 +23,9 @@ angular.module("umbraco.directives") return; } + //when the options item is selected, we need to set the current menu item in appState (since this is synonymous with a menu) + appState.setMenuState("currentNode", scope.currentNode); + if (!scope.actions) { treeService.getMenu({ treeNode: scope.currentNode }) .then(function (data) { diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index e346972706..e4bbd4892b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -194,6 +194,9 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo if (args.activate === undefined || args.activate === true) { //set the current selected node appState.setTreeState("selectedNode", args.node); + //when a node is activated, this is the same as clicking it and we need to set the + //current menu item to be this node as well. + appState.setMenuState("currentNode", args.node); } }); @@ -254,6 +257,8 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo //put this node into the tree state appState.setTreeState("selectedNode", args.node); + //when a node is clicked we also need to set the active menu node to this node + appState.setMenuState("currentNode", args.node); //not legacy, lets just set the route value and clear the query string if there is one. $location.path(n.routePath).search(""); diff --git a/src/Umbraco.Web.UI/umbraco_client/Editors/EditView.js b/src/Umbraco.Web.UI/umbraco_client/Editors/EditView.js index 8d6d3ec36d..87d387b4c5 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Editors/EditView.js +++ b/src/Umbraco.Web.UI/umbraco_client/Editors/EditView.js @@ -8,7 +8,7 @@ //private methods/variables _opts: null, - _updateNewProperties: function(filePath) { + _updateNewFileProperties: function(filePath) { /// Updates the current treeSyncPath and original file name to have the new file name //update the originalFileName prop @@ -129,27 +129,26 @@ UmbClientMgr.mainTree().setActiveTreeType(this._opts.currentTreeType); - var newFilePath = this._opts.nameTxtBox.val(); - if (this._opts.editorType == "Template") { //templates are different because they are ID based, whereas view files are file based without a static id if (pathChanged) { UmbClientMgr.mainTree().moveNode(this._opts.templateId, path); + this._opts.treeSyncPath = path; } else { UmbClientMgr.mainTree().syncTree(path, true); } - } else { - //we need to pass in the newId parameter so it knows which node to resync after retreival from the server + var newFilePath = this._opts.nameTxtBox.val(); + //then we need to update our current tree sync path to represent the new one + this._updateNewFileProperties(newFilePath); + UmbClientMgr.mainTree().syncTree(path, true, null, newFilePath.split("/")[1]); } - - //then we need to update our current tree sync path to represent the new one - this._updateNewProperties(newFilePath); + }, submitFailure: function (err, header) {