| Issue 2019: | revertFunc() doesn't work as expected | |
| 2 people starred this issue and may be notified of changes. | Back to list |
After calling revertFunct() more than once from jQuery's event callback, revert effects stack http://jsfiddle.net/pambuk/5yvNQ/1/ Steps to reproduce: 1. Move event with drag&drop 2. In the popup click 'No' 3. Repeat. What happens is it works for the first time, but when calling revertFunc() again, it will revert events twice, after calling again, three times, and so on. Attached screenshot shows 2 calls to revertFunc() (console log of eventsByID shows 3 times).
Oct 28, 2013
Perfect, works like a charm, thank you very much.
Jun 7, 2014
(No comment was entered for this change.)
Status:
Reproducing
Labels: Type-Bug
Jun 11, 2014
thx for the help rpowers. this is a user error. closing this bug
Status:
Done
|
|
| ► Sign in to add a comment |
Make sure you call unbind on the event (or initialize the dialog event code once somewhere else), since a new click event listener is bound each time the eventDrop function is called. This code fixes it: $('#prompt').show(); var $cancel = $('#cancel-move'); $cancel.unbind('click'); $cancel.click(function () { revertFunc(); $('#prompt').hide(); });