jquery-sortable-lists icon indicating copy to clipboard operation
jquery-sortable-lists copied to clipboard

Max Levels

Open IanRobbRB opened this issue 5 years ago • 11 comments

Is there a way to set the maximum number of levels?

IanRobbRB avatar Jun 07 '20 11:06 IanRobbRB

You can use isAllowed callback to cout levels and deny insertion.

camohub avatar Jun 07 '20 16:06 camohub

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?

IanRobbRB avatar Jun 07 '20 16:06 IanRobbRB

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.

camohub avatar Jun 07 '20 20:06 camohub

Also you can style hint element by css e.g. with display none.

camohub avatar Jun 07 '20 20:06 camohub

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.

camohub avatar Jun 08 '20 09:06 camohub

That sounds great, I will do that. Other than that the plugin is great!

IanRobbRB avatar Jun 08 '20 19:06 IanRobbRB

Almost there ...

camohub avatar Jun 08 '20 19:06 camohub

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.

camohub avatar Jun 08 '20 22:06 camohub

I had a look last night and it is looking really good. The max levels works perfectly!

IanRobbRB avatar Jun 09 '20 08:06 IanRobbRB

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.

camohub avatar Jun 09 '20 15:06 camohub

I made a release of 2.0.0 for NPM and BOWER. Try it if you can.

camohub avatar Jun 09 '20 21:06 camohub