From 57e98fda977bd99a943e05aca1810f800bfc0e33 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 11 Nov 2013 17:54:42 +1100 Subject: [PATCH] Fixes setting the 'section' on a tree node, fixes the editors syncTree call to not force reload when routing to the editor - this will still load in the data for the tree if it is missing, just won't force reload the individual tree node loading. --- .../src/common/services/tree.service.js | 7 ++++--- .../src/views/content/content.edit.controller.js | 2 +- .../src/views/datatype/datatype.edit.controller.js | 2 +- .../src/views/media/media.edit.controller.js | 2 +- .../src/views/member/member.edit.controller.js | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js index 1a1bd898ea..5b6bf1833c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js @@ -43,12 +43,13 @@ function treeService($q, treeResource, iconHelper, notificationsService, $rootSc treeNodes[i].level = childLevel; treeNodes[i].parent = parentNode; - + + //set the section for each tree node - this allows us to reference this easily when accessing tree nodes + treeNodes[i].section = section; + //if there is not route path specified, then set it automatically, //if this is a tree root node then we want to route to the section's dashboard if (!treeNodes[i].routePath) { - //set the section for each tree node - this allows us to reference this easily when accessing tree nodes - treeNodes[i].section = section; if (treeNodes[i].metaData && treeNodes[i].metaData["treeAlias"]) { //this is a root node diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js index 98af9e1d62..2b1c693b2a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js @@ -162,7 +162,7 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont // if there are any and then clear them so the collection no longer persists them. serverValidationManager.executeAndClearAllSubscriptions(); - navigationService.syncTree({ tree: "content", path: data.path.split(","), forceReload: true }); + navigationService.syncTree({ tree: "content", path: data.path.split(",") }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js index 99aa4a0ea4..b7a7805b3f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/datatype/datatype.edit.controller.js @@ -65,7 +65,7 @@ function DataTypeEditController($scope, $routeParams, $location, navigationServi // if there are any and then clear them so the collection no longer persists them. serverValidationManager.executeAndClearAllSubscriptions(); - navigationService.syncTree({ tree: "datatype", path: [String(data.id)], forceReload: true }); + navigationService.syncTree({ tree: "datatype", path: [String(data.id)] }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js index 49fdb99d3c..bf720e959e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js @@ -30,7 +30,7 @@ function mediaEditController($scope, $routeParams, mediaResource, navigationServ // if there are any and then clear them so the collection no longer persists them. serverValidationManager.executeAndClearAllSubscriptions(); - navigationService.syncTree({ tree: "media", path: data.path, forceReload: true }); + navigationService.syncTree({ tree: "media", path: data.path }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js index 7c39e3b017..2b0ef1a2c1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/member/member.edit.controller.js @@ -42,7 +42,7 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, memb var path = data.name[0]+"," + data.key; path = path.replace(/-/g,''); - navigationService.syncTree({ tree: "member", path: path.split(","), forceReload: true }); + navigationService.syncTree({ tree: "member", path: path.split(",") }); //in one particular special case, after we've created a new item we redirect back to the edit // route but there might be server validation errors in the collection which we need to display