Skip to content

Commit

Permalink
FIXED: comparison operators
Browse files Browse the repository at this point in the history
Fixed the operators to use '==' instead of '='
  • Loading branch information
charsleysa committed May 21, 2013
1 parent 38b5869 commit 751c44f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 751c44f

Please sign in to comment.