BUGFIX #2706: Fixed JS error in multi-nested pages deletion

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@65896 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-14 00:41:49 +00:00
parent 98f749cdb8
commit f001eee5fe

View File

@ -793,7 +793,7 @@ HTML;
FormResponse::add("\$('sitetree').setNodeTitle($page->ID, '$JS_title');");
} else {
FormResponse::add("var node = $('sitetree').getTreeNodeByIdx('$page->ID');");
FormResponse::add("if(node.parentTreeNode) node.parentTreeNode.removeTreeNode(node);");
FormResponse::add("if(node && node.parentTreeNode) node.parentTreeNode.removeTreeNode(node);");
FormResponse::add("$('Form_EditForm').reloadIfSetTo($page->ID);");
}
@ -1069,7 +1069,7 @@ HTML;
FormResponse::add("$('Form_EditForm').reloadIfSetTo($record->OldID);");
} else {
FormResponse::add("var node = $('sitetree').getTreeNodeByIdx('$id');");
FormResponse::add("if(node.parentTreeNode) node.parentTreeNode.removeTreeNode(node);");
FormResponse::add("if(node && node.parentTreeNode) node.parentTreeNode.removeTreeNode(node);");
FormResponse::add("$('Form_EditForm').reloadIfSetTo($record->OldID);");
}
}