Need a way to unbind event.
There is a way to bind a touch-layer event, such as 'swipe'. But, there is no way to unbind it. (ie, gt('swipe', function() { ... });
I made a patch on this, because I need it.
I am not sure calling onEnd is entirely correct in all cases. Please review. Thanks!
https://github.com/beedesk/touch-layer/commit/3af84685cddb9fe37ec367fda70ed88e3ebd2097
Thanks for the report, it's a known "bug". Events get registered into an array, I just have to add the unbind method which traverses the array and remove the listeners.
The link in my first comment included this patch. Hope this help. Thanks.
@@ -99,7 +99,40 @@ NL.prototype = {
...
off: function (type, fn) {
if (!type) {
return;
}
var that = this;
type = type.toLowerCase();
if (!customEvents[type]) {
return that;
}
var results = [];
for (var i=(eventList.length - 1); i >= 0; i--) {
if (this[0] == eventList[i].el[0]) {
var events = eventList[i];
if (events.type === events.type) {
if (!fn || events.fn === fn) {
results.push(events);
eventList.splice(i, 1);
}
}
}
}
for (var i=0, len=results.length; i
It seems like this is still an open issue. Is there a planned fix? Thanks.