Fixes: U4-3440 Tempates (MVC Views) tree sync doesn't work correctly

This commit is contained in:
Shannon
2013-11-19 17:17:39 +11:00
parent d3b8ac31c7
commit 5fc82fef18
3 changed files with 15 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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("");

View File

@@ -8,7 +8,7 @@
//private methods/variables
_opts: null,
_updateNewProperties: function(filePath) {
_updateNewFileProperties: function(filePath) {
/// <summary>Updates the current treeSyncPath and original file name to have the new file name</summary>
//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) {