Ticket #2914 (closed enhancement: fixed)

Opened 7 years ago

Last modified 7 years ago

Draggable: make revert a method

Reported by: ivan Owned by: paul
Priority: minor Milestone: 1.5.2
Component: ui.draggable Version: 1.5b4
Keywords: Cc:
Blocking: Blocked by:


A pretty common need with draggables/droppables is to accept the drop, do some processing, and then, if some conditions are not met, restore the draggable to the original position.
I think it would make sense to make 'revert' callable externally (for example in the 'drop' method of the droppable).
The attached patch does that: unfortunately, at the moment it requires setting draggableInstance.cancelHelperRemoval = true; in the draggable 'stop' or in the droppable 'drop' methods, to prevent the helper from being removed too soon (see also  here for a discussion).


ui.draggable.js.patch Download (1.8 KB) - added by ivan 7 years ago.

Change History

Changed 7 years ago by ivan

comment:1 Changed 7 years ago by anonymous

  • Milestone 1.2.4 deleted

Milestone 1.2.4 deleted

comment:2 Changed 7 years ago by paul

  • Version changed from 1.2.3 to 1.5b4
  • Component changed from ui.core to ui.draggable

comment:3 Changed 7 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 1.5.2

Done in r402. Use revert: "invalid"

Note: See TracTickets for help on using tickets.