From c34a1060f74f45f1e37e1bd158d0453e6aae6f4b Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Thu, 20 Apr 2017 15:49:49 +0100 Subject: [PATCH] When we create a brand new template & set a master template we were removing the entire tree for templates - this adds in a check to not do the remove of the old node if its a brand new template we are creating --- .../src/views/templates/edit.controller.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index 45dba79ad5..30e5326621 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -60,10 +60,14 @@ // sync tree // if master template alias has changed move the node to it's new location if(oldMasterTemplateAlias !== vm.template.masterTemplateAlias) { + + //Only do this if we are not on the initial create route param - /-1?create=true + if ($routeParams.create === false) { - // move node to new location in tree - //first we need to remove the node that we're working on - treeService.removeNode(vm.page.menu.currentNode); + // move node to new location in tree + //first we need to remove the node that we're working on + treeService.removeNode(vm.page.menu.currentNode); + } // update stored alias to the new one so the node won't move again unless the alias is changed again oldMasterTemplateAlias = vm.template.masterTemplateAlias;