BUGFIX Check original page type of VirtualPage when doing tree drop target checks (AIR-81)

This commit is contained in:
Ingo Schommer 2012-01-12 22:34:05 +01:00
parent cf610974e3
commit 323edd03cb

View File

@ -422,6 +422,15 @@ SiteTreeNode.prototype = {
alert("You can't add children to that node");
return false;
}
// Special case for VirtualPage: Check that original page type is an allowed child
if(Element.hasClassName(node, 'VirtualPage') && node.className.match(/VirtualPage-([^\s]*)/)) {
var nodeClass = RegExp.$1
if(nodeClass && newParent.hints.allowedChildren.indexOf(nodeClass) == -1) {
alert("You can't move a virtual page with an original type of '" + nodeClass + '" here');
return false;
}
}
var currentlyOpenPageID = 0;
if($('Form_EditForm').elements.ID) currentlyOpenPageID = $('Form_EditForm').elements.ID.value;