Opened 14 years ago

Closed 14 years ago

#3175 closed enhancement (fixed)

Draggable revert: option can be a callback

Reported by: kevingessner Owned by: paul
Priority: minor Milestone: 1.7
Component: ui.draggable Version: 1.5.2
Keywords: draggable revert Cc:
Blocked by: Blocking:


Attached is a patch w/ test that adds the capability for draggable's revert: option to be a function, rather than just true/false/(in)valid. The function is called on drop, and the return value is used the same as constant true/false values. It gives more flexibility than simply using a constant value.

Caveat: I'm not sure what arguments should be passed to the callback, if any - I couldn't tell where the standard (e, ui) come from, or if those are appropriate.

(I hope I'm doing this right. Sorry, it's my first ticket/contribution here. And I'm not sure how the test suite works, so mine's a separate file. Thanks!)

Attachments (1)

draggable-revert.patch (2.3 KB) - added by kevingessner 14 years ago.
Patch for ui.draggable adding callback capability to revert: (with test)

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by kevingessner

Attachment: draggable-revert.patch added

Patch for ui.draggable adding callback capability to revert: (with test)

comment:1 Changed 14 years ago by Cloudream

Milestone: 1.6

comment:2 Changed 14 years ago by paul

Resolution: fixed
Status: newclosed

Thanks, implemented in r689.

Note: See TracTickets for help on using tickets.