kornelski / slip

Slip.js — UI library for manipulating lists via swipe and drag gestures
BSD 2-Clause "Simplified" License
2.44k stars 213 forks source link

Event for cancelled swipe #18

Closed fonini closed 10 years ago

fonini commented 10 years ago

Hi,

it would be nice if there was an event like 'cancelswipe', to be fired when the user stops dragging the list item and the item returns to it's original position.

Thanks for the awesome lib!

kornelski commented 10 years ago

Good idea. Can you try adding it?

On 8 July 2014 14:07:36 Jonnas Fonini notifications@github.com wrote:

Hi,

it would be nice if there was an event like 'cancelswipe', to be fired when the user stops dragging the list item and the item returns to it's original position.

Thanks for the awesome lib!


Reply to this email directly or view it on GitHub: https://github.com/pornel/slip/issues/18

fonini commented 10 years ago

My solution was adding the following line above this.animateToZero:

this.animateToZero(removeClass);
this.dispatch(this.target.node, 'cancelswipe');

If you want, I can submit a PR. You may change the event name.

kornelski commented 10 years ago

Yes, please make PR, but rename the event to slip:cancelswipe.