@avvio-reply/clickortouch
Advanced tools
Comparing version 1.0.9 to 1.0.10
19
index.js
@@ -16,11 +16,20 @@ /// | ||
var ClickOrTouch = function (selector, useLock, onEvent, acceptGesturesAsClick) { | ||
var ClickOrTouch = function (selector, useLock, onEvent, options) { | ||
if (typeof acceptGesturesAsClick != 'boolean') | ||
acceptGesturesAsClick = false; | ||
var _options = $.extend({}, { | ||
"preventDefault": true, | ||
"acceptGesturesAsClick": false | ||
}, options); | ||
if (typeof _options.preventDefault != 'boolean') | ||
_options.preventDefault = true; | ||
if (typeof _options.acceptGesturesAsClick != 'boolean') | ||
_options.acceptGesturesAsClick = false; | ||
var self = this | ||
, handler = function (e, userParam) { | ||
e.preventDefault(); | ||
if (_options.preventDefault) | ||
e.preventDefault(); | ||
@@ -30,3 +39,3 @@ self.$target = $(e.currentTarget); | ||
/* ignore click/touch on scroll event */ | ||
if (e.type == touchmove && !acceptGesturesAsClick) { | ||
if (e.type == touchmove && !_options.acceptGesturesAsClick) { | ||
self.cancel = true; | ||
@@ -33,0 +42,0 @@ return true; |
{ | ||
"name": "@avvio-reply/clickortouch", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "Module to simplify handling of click or touch events between browsers and tablet/mobile. Includes lock/release feature.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3095
67