Skip to content

Commit 6a92047

Browse files
author
@soyjavi
committed
Refactor isSwipe method
1 parent 725f629 commit 6a92047

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

source/quo.gestures.coffee

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ do ($$ = Quo) ->
7575
fingers = touches.length
7676
if fingers == GESTURE.fingers
7777
CURRENT_TOUCH = _fingersPosition(touches, fingers)
78-
is_swipe = _isSwipe(event)
79-
if is_swipe then GESTURE.prevSwipe = true
80-
_trigger "swiping" if (is_swipe or GESTURE.prevSwipe is true)
78+
_trigger "swiping" if _isSwipe(event)
8179
if fingers == 2
8280
_captureRotation()
8381
_capturePinch()
@@ -92,6 +90,7 @@ do ($$ = Quo) ->
9290
move_horizontal = Math.abs(FIRST_TOUCH[0].x - CURRENT_TOUCH[0].x) > 30
9391
move_vertical = Math.abs(FIRST_TOUCH[0].y - CURRENT_TOUCH[0].y) > 30
9492
it_is = GESTURE.el and (move_horizontal or move_vertical)
93+
GESTURE.prevSwipe = it_is
9594
it_is
9695

9796
_onTouchEnd = (event) ->

0 commit comments

Comments
 (0)