Open IanRobbRB opened 4 years ago
You can use isAllowed callback to cout levels and deny insertion.
How would that work? Would that not stop all dragging and dropping completely? So if I just wanted the top level and then the one level underneath?
I am on the phone. But the first example in documentation contains c block which uses isAllowed calback to deny insertion. Open source code and you will see that.
Also you can style hint element by css e.g. with display none.
I am working on maxLevel feature. You can wait for it if you want. It was little complicated to handle levels via isAllowed callback. So I decided to add this feature. Hope I'll do it today.
That sounds great, I will do that. Other than that the plugin is great!
Almost there ...
I made it to dev branch https://github.com/camohub/jquery-sortable-lists/tree/dev But there is a problem with drop speed after few drag operation it starts to be very slow. Is 0:45 here I am going to sleep. Hope I will solve it morning. You can test it but only non-mobile version.
I had a look last night and it is looking really good. The max levels works perfectly!
There was a bug. Now it is fixed in dev branch. Also I changed names for classes and ids. Everything started with sortableListsXXX... now begins with s-l-XXX.
I made a release of 2.0.0 for NPM and BOWER. Try it if you can.
Is there a way to set the maximum number of levels?