Permalink
Browse files

ENHANCEMENT Added 'nochildren' support to new jstree implementation

  • Loading branch information...
1 parent bde2696 commit 601665519b4886d0dc39e60ecc03dc6b6a348c98 @chillu chillu committed Apr 7, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 admin/javascript/LeftAndMain.Tree.js
@@ -19,7 +19,6 @@
* @todo Add siteTreeHints to field (as "data-hints" attribute with serialized JSON instead of javascript global variable)
* @todo Disallow drag'n'drop when node has "noChildren" set (see siteTreeHints)
* @todo Disallow moving of pages marked as deleted
- * @todo Enforce sitetreeHints rules on page creation ("allowedChildren", "noChildren") -
* most likely by server response codes rather than clientside
* @todo "defaultChild" when creating a page (sitetreeHints)
* @todo Duplicate page (originally located in context menu)
@@ -65,6 +64,8 @@
movedNode.data('id') != 0
// Only allow moving node inside the root container, not before/after it
&& (!isMovedOntoContainer || data.p == 'inside')
+ // Children are generally allowed on parent
+ && !newParent.hasClass('nochildren')
// movedNode is allowed as a child
&& ($.inArray(movedNodeClass, allowedChildren) != -1)
);

0 comments on commit 6016655

Please sign in to comment.