From 1cb9f90f1b9e397d3fd6fba7911c0cd26b3937d7 Mon Sep 17 00:00:00 2001 From: rmertz3 Date: Thu, 11 Jan 2018 15:55:57 -0500 Subject: [PATCH 1/2] added class for blocking item from accepting children --- jquery.nestable.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jquery.nestable.js b/jquery.nestable.js index 7323fb4..660489b 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 From cdb02c088ae0fbc8547207c55fa7c45ee765ca4f Mon Sep 17 00:00:00 2001 From: rmertz3 Date: Thu, 11 Jan 2018 15:58:28 -0500 Subject: [PATCH 2/2] formatting --- jquery.nestable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.nestable.js b/jquery.nestable.js index 660489b..ef88ea9 100644 --- a/jquery.nestable.js +++ b/jquery.nestable.js @@ -37,7 +37,7 @@ collapsedClass : 'dd-collapsed', placeClass : 'dd-placeholder', noDragClass : 'dd-nodrag', - noChildrenClass : 'dd-nochildren', + noChildrenClass : 'dd-nochildren', emptyClass : 'dd-empty', expandBtnHTML : '', collapseBtnHTML : '',