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

complete is called after each click and not only after a drop to another position #16

Closed
dirkjacobs opened this issue Nov 4, 2015 · 9 comments
Labels

Comments

@dirkjacobs
Copy link

I would like to persist the menu in case the position was changed after a drop.
I implemented this in the 'complete' callback but I see that this callback is also called after just clicking a menu-item and not only after a drop to another position as expected.

@camohub
Copy link
Owner

camohub commented Nov 4, 2015

Yes it is called every time after the drop. Not only if the position was changed. But I think that there is a way to check if the position is the same right in complete callback. Or you will do some redundant persists. Is it problem?

@srdjanpejic
Copy link

I have an issue also with this. I want to trigger an ajax call after complete drop not after every click on element which is considered as complete move.

@camohub
Copy link
Owner

camohub commented Nov 17, 2015

Try to save position or parent el. or both by onDragStart callback and check it in complete callback. If it is the same position don't trigger ajax.

@camohub
Copy link
Owner

camohub commented Nov 17, 2015

May be it could be the implemented in plugin as onChange callback.

@srdjanpejic
Copy link

Yes, maybe you should change the wording. Rename "Complete" to "Change" and implement new callback "Update" which will be called after user drops element.

@camohub
Copy link
Owner

camohub commented Nov 18, 2015

Why update if nothing was updated?

@srdjanpejic
Copy link

Hm... Yes, it makes sense.

Then leave Complete callback and implement Change callback as you wrote above. 👍

@camohub
Copy link
Owner

camohub commented Nov 20, 2015

Ok onChange callback was implemented.

@srdjanpejic
Copy link

Oh, great, it was quick 😄
I test it, it's working

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

No branches or pull requests

3 participants