Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max Levels #55

Open
IanRobbRB opened this issue Jun 7, 2020 · 11 comments
Open

Max Levels #55

IanRobbRB opened this issue Jun 7, 2020 · 11 comments

Comments

@IanRobbRB
Copy link

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

@camohub
Copy link
Owner

camohub commented Jun 7, 2020

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

@IanRobbRB
Copy link
Author

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?

@camohub
Copy link
Owner

camohub commented Jun 7, 2020

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
Copy link
Owner

camohub commented Jun 7, 2020

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

@camohub
Copy link
Owner

camohub commented Jun 8, 2020

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.

@IanRobbRB
Copy link
Author

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

@camohub
Copy link
Owner

camohub commented Jun 8, 2020

Almost there ...

@camohub
Copy link
Owner

camohub commented Jun 8, 2020

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.

@IanRobbRB
Copy link
Author

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

@camohub
Copy link
Owner

camohub commented Jun 9, 2020

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
Copy link
Owner

camohub commented Jun 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants