@@ -36,31 +36,30 @@ export default {
36
36
37
37
this . swipeStart = true
38
38
} ,
39
+ /* eslint-disable complexity */
39
40
handleTouchMove ( event ) {
40
- if ( ! this . swipeStart ) {
41
- return
42
- }
43
-
44
- const touchmoveX = event . touches [ 0 ] . screenX
45
- const touchmoveY = event . touches [ 0 ] . screenY
41
+ if ( this . swipeStart ) {
42
+ const touchmoveX = event . touches [ 0 ] . screenX
43
+ const touchmoveY = event . touches [ 0 ] . screenY
46
44
47
- const actualX = touchmoveX - this . touchPosition . startX
48
- const actualY = touchmoveY - this . touchPosition . startY
45
+ const actualX = touchmoveX - this . touchPosition . startX
46
+ const actualY = touchmoveY - this . touchPosition . startY
49
47
50
- const elapsedTime = new Date ( ) - this . swipeStartTime
48
+ const elapsedTime = new Date ( ) - this . swipeStartTime
51
49
52
- if ( elapsedTime <= this . mdSwipeTime ) {
53
- if ( Math . abs ( actualX ) >= this . mdSwipeThreshold && Math . abs ( actualY ) <= this . mdSwipeRestraint ) {
54
- this . swiped = actualX < 0
55
- ? 'left'
56
- : 'right'
57
- } else if ( Math . abs ( actualY ) >= this . mdSwipeThreshold && Math . abs ( actualX ) <= this . mdSwipeRestraint ) {
58
- this . swiped = actualY < 0
59
- ? 'up'
60
- : 'down'
50
+ if ( elapsedTime <= this . mdSwipeTime ) {
51
+ if ( Math . abs ( actualX ) >= this . mdSwipeThreshold && Math . abs ( actualY ) <= this . mdSwipeRestraint ) {
52
+ this . swiped = actualX < 0
53
+ ? 'left'
54
+ : 'right'
55
+ } else if ( Math . abs ( actualY ) >= this . mdSwipeThreshold && Math . abs ( actualX ) <= this . mdSwipeRestraint ) {
56
+ this . swiped = actualY < 0
57
+ ? 'up'
58
+ : 'down'
59
+ }
61
60
}
62
61
}
63
- } ,
62
+ } , /* eslint-enable complexity */
64
63
handleTouchEnd ( ) {
65
64
this . touchPosition = {
66
65
startX : 0 ,
0 commit comments