Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add config option to automatically call preventDefault() on the onclick event #13

Merged
merged 1 commit into from Dec 1, 2012
Jump to file or symbol
Failed to load files and symbols.
+13 −1
Split
View
@@ -330,6 +330,12 @@
}
+ if(typeof conf.preventClick!=='undefined'){
+
+ this.preventClick=conf.preventClick;
+
+ }
+
}
this.$elem.bind('touchstart', function(e){
@@ -344,7 +350,13 @@
});
this.$elem.bind('touchmove', touchmove);
this.$elem.bind('touchend', touchend);
+
+ if (this.preventClick) {
+ this.$elem.bind('click', function (e) {
+ e.preventDefault();
+ });
+ }
}
-})(jQuery);//end closure
+})(jQuery);//end closure