diff --git a/jquery.nestable.js b/jquery.nestable.js index 7323fb4..ef88ea9 100644 --- a/jquery.nestable.js +++ b/jquery.nestable.js @@ -37,6 +37,7 @@ collapsedClass : 'dd-collapsed', placeClass : 'dd-placeholder', noDragClass : 'dd-nodrag', + noChildrenClass : 'dd-nochildren', emptyClass : 'dd-empty', expandBtnHTML : '', collapseBtnHTML : '', @@ -358,8 +359,8 @@ // reset move distance on x-axis for new phase mouse.distAxX = 0; prev = this.placeEl.prev(opt.itemNodeName); - // increase horizontal level if previous sibling exists and is not collapsed - if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) { + // increase horizontal level if previous sibling exists and is not collapsed and accepts children + if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass) && !prev.hasClass(opt.noChildrenClass)) { // cannot increase level when item above is collapsed list = prev.find(opt.listNodeName).last(); // check if depth limit has reached @@ -481,4 +482,4 @@ return retval || lists; }; -})(window.jQuery || window.Zepto, window, document); +})(window.jQuery || window.Zepto, window, document); \ No newline at end of file