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

Add animateswipe event #73

Closed carter-thaxton closed 8 years ago

carter-thaxton commented 8 years ago

I added this slip:animateswipe event to support the display of some icons "behind" the element being swiped, e.g. to show a delete icon. All of the logic to show the icon is in my app, but this event made it possible. Seems generally useful.

I considered something similar for slip:animatereorder, but it would be considerably more complex, and I don't see the obvious use case, so it's not in this pull request.

Also, it makes sense to emit slip:cancelswipe when the user drags far enough up or down to cancel the swipe. This way, after emitting slip:beforeswipe, we always emit either slip:cancelswipe or slip:swipe. This change was also necessary to make my swipe icons work properly.

kornelski commented 8 years ago

Thank you. That's very useful indeed.

kornelski commented 8 years ago

You're taking better care of this library than I do, so I've added you to project collaborators :)

carter-thaxton commented 8 years ago

Hey thanks, @pornel. I've already started closing and taking care of some old issues. When the time is right, I think you'll still need to update the repository on bower.

Also, you'll need to update your website at https://kornel.ski/slip/ You'll notice I went ahead and added the source of your online demo to the project as example.html. Ideally, we can keep the demo in sync with the source.

kornelski commented 8 years ago

OK