gajus / swing

A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder.
Other
2.64k stars 248 forks source link

Added css class to disable a card #128

Closed DoryZi closed 4 years ago

DoryZi commented 6 years ago

Some people need to make the card stop swinging, I found a way to do that using a css class. Here it is.

gajus commented 6 years ago

It would help to link to the issues you are referring to and explaining what/ how your are solving a problem.

This looks extremely hackish.

DoryZi commented 6 years ago

Ok sure, what do you mean link the issues? The main issue is sometime we want to disable the card from behaving like a card and being drag-able, throw-able, I'm also using this in an angular2 component, meaning this is warped with the angular2-swing project, which makes accessing the hammer.js of the swing complex to being with. The idea that I had was to easily ass a class to the card, as it seems that we don't always have access to the Card instance in the events, and then to disable. If you have a better suggestion or idea on how to do this I'm happy to dedicate a more time to make this proper, however for now what I have does work..

Also what did you mean link the issues ?