fix removeNode check to only be for the root node

This commit is contained in:
Mads Rasmussen
2017-04-24 12:46:45 +02:00
parent c34a1060f7
commit 55022e2aaf

View File

@@ -61,9 +61,8 @@
// 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) {
// When creating a new template the id is -1. Make sure We don't remove the root node.
if (vm.page.menu.currentNode.id !== "-1") {
// 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);