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

resizable/draggable.stop callback should be able cancellable #14

Closed
nghiado opened this issue Mar 27, 2017 · 6 comments
Closed

resizable/draggable.stop callback should be able cancellable #14

nghiado opened this issue Mar 27, 2017 · 6 comments

Comments

@nghiado
Copy link

nghiado commented Mar 27, 2017

Can you support promise/cancellable for the stop callback?
A simple use case is users want to rearrange the widget position but we want their confirmation(via popup dialog) before apply new position.

@tiberiuzuld
Copy link
Owner

Hi @nghiado,
It is possible, will implement it this week.

tiberiuzuld added a commit that referenced this issue Mar 31, 2017
@tiberiuzuld
Copy link
Owner

Hi @nghiado ,
Implemented this in v2.4.0

@nghiado
Copy link
Author

nghiado commented Mar 31, 2017

Thanks @tiberiuzuld, will try this weekend.

@PeterSeifert
Copy link

Can you please provide an example on how this callback should look like with the posibility to cancel it?

@tiberiuzuld
Copy link
Owner

tiberiuzuld commented Oct 9, 2017

Hi @PeterSeifert ,
You need to return a promise from the callback like:

vm.options.draggable.stop = areYouSureCallback;

function areYouSureCallback(item, itemComponent, event){
     return new Promise(function(resolve, reject){
        /// do your stuff here
    });
}

Thanks,

@PeterSeifert
Copy link

Thank you, @tiberiuzuld. This helped me.

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

No branches or pull requests

3 participants