mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX Check original page type of VirtualPage when doing tree drop target checks (AIR-81)
This commit is contained in:
parent
cf610974e3
commit
323edd03cb
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user