From 751c44fbe6509bbfdc56ef0ffe071ccc207878c0 Mon Sep 17 00:00:00 2001 From: charsleysa Date: Tue, 21 May 2013 13:08:14 +1200 Subject: [PATCH] FIXED: comparison operators Fixed the operators to use '==' instead of '=' --- src/touch.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/touch.js b/src/touch.js index cf111c3e4..5f5207770 100644 --- a/src/touch.js +++ b/src/touch.js @@ -43,27 +43,27 @@ $(document.body) .on('touchstart MSPointerDown', function(e){ - if(e.type = 'MSPointerDown' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; + if(e.type == 'MSPointerDown' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; now = Date.now() delta = now - (touch.last || now) - touch.el = $(parentIfText(e.type = 'MSPointerDown' ? e.target : e.touches[0].target)) + touch.el = $(parentIfText(e.type == 'MSPointerDown' ? e.target : e.touches[0].target)) touchTimeout && clearTimeout(touchTimeout) - touch.x1 = (e.type = 'MSPointerDown' ? e.pageX : e.touches[0].pageX) - touch.y1 = (e.type = 'MSPointerDown' ? e.pageY : e.touches[0].pageY) + touch.x1 = (e.type == 'MSPointerDown' ? e.pageX : e.touches[0].pageX) + touch.y1 = (e.type == 'MSPointerDown' ? e.pageY : e.touches[0].pageY) if (delta > 0 && delta <= 250) touch.isDoubleTap = true touch.last = now longTapTimeout = setTimeout(longTap, longTapDelay) }) .on('touchmove MSPointerMove', function(e){ - if(e.type = 'MSPointerMove' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; + if(e.type == 'MSPointerMove' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; cancelLongTap() - touch.x2 = (e.type = 'MSPointerMove' ? e.pageX : e.touches[0].pageX) - touch.y2 = (e.type = 'MSPointerMove' ? e.pageY : e.touches[0].pageY) + touch.x2 = (e.type == 'MSPointerMove' ? e.pageX : e.touches[0].pageX) + touch.y2 = (e.type == 'MSPointerMove' ? e.pageY : e.touches[0].pageY) if (Math.abs(touch.x1 - touch.x2) > 10) e.preventDefault() }) .on('touchend MSPointerUp', function(e){ - if(e.type = 'MSPointerUp' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; + if(e.type == 'MSPointerUp' && (e.pointerType != e.MSPOINTER_TYPE_TOUCH || !e.isPrimary)) return; cancelLongTap() // swipe