soyjavi / QuoJS

Micro #JavaScript Library for Mobile Devices
MIT License
2.07k stars 236 forks source link

unbind not working on mobile events (touchstart, touchmove, touchend, swipe ...) #36

Closed vmkcom closed 11 years ago

vmkcom commented 12 years ago

var func = function() {console.log('touchstart')}

$$(window).on('touchstart', func);

after that when i do

$$(window).off('touchstart', func) -> i see "touchstart" at console anyway

soyjavi commented 11 years ago

"func" is the same function??

vmkcom commented 11 years ago

Yes, function is the same. Interesting, that bug reproduced only if I use "off" with 2 parameters - event and function. I only can use off with event and remove all functions but this isn't useful. Thanks for reply. I use quojs for ios

soyjavi commented 11 years ago

Fixed! :)

https://github.com/soyjavi/QuoJS/commit/58168bd45702f45683040dd9976eded48e6f9362

bwasilewski commented 11 years ago

I am experiencing this problem... when I call $('.selector').off('swipeLeft', function (ev) { alert('removed'); }); the event is still bound. Am I doing something wrong?