docubuzz / touch-sortable.js

A tiny, animated, sortable plugin for jQuery, supporting both touch and mouse events.
http://docubuzz.github.io/touch-sortable.js
Other
7 stars 1 forks source link

Chrome & Opera #7

Open matsuki820 opened 10 years ago

matsuki820 commented 10 years ago

I really liked the plugin, however it's not working with mouse events in the latest version of Chrome and Opera. Any way I can help solve this issue? great work by the way.

ashishpuliyel commented 10 years ago

What version of chrome are you using? I'm using 31.0.1650.57 on OSX and it seems to be OK. Use the demo page http://docubuzz.github.io/touch-sortable.js/ to test.

Cheers, A

jieyanhuang commented 10 years ago

Could you provide more details? I've tested it on Opera version 18.0.1284.68 and Chrome Version 31.0.1650.63 m, both on Windows 7, and they seem to be working fine on the demo page

matsuki820 commented 10 years ago

I'm using version 31.0.1650.63 m on Windows 8. I'm able to play with it with touch input but not with my mouse. I was going through the code and I see a startEvent variable where you define the event to use, The problem is that my computer has a touchscreen so it gets the touchstart event only then it ignores mouse events. Cheers

ashishpuliyel commented 10 years ago

Ok. I understand now. The issue is we look to see if the browser supports touch events, and if it does, we bind to touch events. It should be possible to bind to both types of events instead of either. Try changing line 10 from:

.on(startEvent, onStart)

to:

.on('touchstart mousedown', onStart)

There may be other side-effects, test it and let us know?

matsuki820 commented 10 years ago

I made the change and it's working now. So far I´ve tested it in IE10, Opera, Firefox, Chrome on Android and Safari on iPad. So far I haven't had any issues, but I'll let you know if something comes up. Thanks!