1
1
/*!
2
- * Glide.js v3.2.6
2
+ * Glide.js v3.2.7
3
3
* (c) 2013-2019 Jędrzej Chałubek <[email protected] > (http://jedrzejchalubek.com/)
4
4
* Released under the MIT License.
5
5
*/
@@ -2547,7 +2547,6 @@ function Swipe (Glide, Components, Events) {
2547
2547
var swipeStartX = 0 ;
2548
2548
var swipeStartY = 0 ;
2549
2549
var disabled = false ;
2550
- var moveable = true ;
2551
2550
var capture = supportsPassive$1 ? { passive : true } : false ;
2552
2551
2553
2552
var Swipe = {
@@ -2573,7 +2572,6 @@ function Swipe (Glide, Components, Events) {
2573
2572
2574
2573
var swipe = this . touches ( event ) ;
2575
2574
2576
- moveable = true ;
2577
2575
swipeSin = null ;
2578
2576
swipeStartX = toInt ( swipe . pageX ) ;
2579
2577
swipeStartY = toInt ( swipe . pageY ) ;
@@ -2610,7 +2608,7 @@ function Swipe (Glide, Components, Events) {
2610
2608
2611
2609
swipeSin = Math . asin ( swipeCathetus / swipeHypotenuse ) ;
2612
2610
2613
- if ( moveable && swipeSin * 180 / Math . PI < touchAngle ) {
2611
+ if ( swipeSin * 180 / Math . PI < touchAngle ) {
2614
2612
event . stopPropagation ( ) ;
2615
2613
2616
2614
Components . Move . make ( subExSx * toFloat ( touchRatio ) ) ;
@@ -2619,8 +2617,6 @@ function Swipe (Glide, Components, Events) {
2619
2617
2620
2618
Events . emit ( 'swipe.move' ) ;
2621
2619
} else {
2622
- moveable = false ;
2623
-
2624
2620
return false ;
2625
2621
}
2626
2622
}
@@ -2646,33 +2642,31 @@ function Swipe (Glide, Components, Events) {
2646
2642
2647
2643
this . enable ( ) ;
2648
2644
2649
- if ( moveable ) {
2650
- if ( swipeDistance > threshold && swipeDeg < settings . touchAngle ) {
2651
- // While swipe is positive and greater than threshold move backward.
2652
- if ( settings . perTouch ) {
2653
- steps = Math . min ( steps , toInt ( settings . perTouch ) ) ;
2654
- }
2655
-
2656
- if ( Components . Direction . is ( 'rtl' ) ) {
2657
- steps = - steps ;
2658
- }
2645
+ if ( swipeDistance > threshold && swipeDeg < settings . touchAngle ) {
2646
+ // While swipe is positive and greater than threshold move backward.
2647
+ if ( settings . perTouch ) {
2648
+ steps = Math . min ( steps , toInt ( settings . perTouch ) ) ;
2649
+ }
2659
2650
2660
- Components . Run . make ( Components . Direction . resolve ( '<' + steps ) ) ;
2661
- } else if ( swipeDistance < - threshold && swipeDeg < settings . touchAngle ) {
2662
- // While swipe is negative and lower than negative threshold move forward.
2663
- if ( settings . perTouch ) {
2664
- steps = Math . max ( steps , - toInt ( settings . perTouch ) ) ;
2665
- }
2651
+ if ( Components . Direction . is ( 'rtl' ) ) {
2652
+ steps = - steps ;
2653
+ }
2666
2654
2667
- if ( Components . Direction . is ( 'rtl' ) ) {
2668
- steps = - steps ;
2669
- }
2655
+ Components . Run . make ( Components . Direction . resolve ( '<' + steps ) ) ;
2656
+ } else if ( swipeDistance < - threshold && swipeDeg < settings . touchAngle ) {
2657
+ // While swipe is negative and lower than negative threshold move forward.
2658
+ if ( settings . perTouch ) {
2659
+ steps = Math . max ( steps , - toInt ( settings . perTouch ) ) ;
2660
+ }
2670
2661
2671
- Components . Run . make ( Components . Direction . resolve ( '>' + steps ) ) ;
2672
- } else {
2673
- // While swipe don't reach distance apply previous transform.
2674
- Components . Move . make ( ) ;
2662
+ if ( Components . Direction . is ( 'rtl' ) ) {
2663
+ steps = - steps ;
2675
2664
}
2665
+
2666
+ Components . Run . make ( Components . Direction . resolve ( '>' + steps ) ) ;
2667
+ } else {
2668
+ // While swipe don't reach distance apply previous transform.
2669
+ Components . Move . make ( ) ;
2676
2670
}
2677
2671
2678
2672
Components . Html . root . classList . remove ( settings . classes . dragging ) ;
@@ -3087,6 +3081,8 @@ function Controls (Glide, Components, Events) {
3087
3081
*/
3088
3082
var Binder = new EventsBinder ( ) ;
3089
3083
3084
+ var capture = supportsPassive$1 ? { passive : true } : false ;
3085
+
3090
3086
var Controls = {
3091
3087
/**
3092
3088
* Inits arrows. Binds events listeners
@@ -3202,7 +3198,8 @@ function Controls (Glide, Components, Events) {
3202
3198
*/
3203
3199
bind : function bind ( elements ) {
3204
3200
for ( var i = 0 ; i < elements . length ; i ++ ) {
3205
- Binder . on ( [ 'click' , 'touchstart' ] , elements [ i ] , this . click ) ;
3201
+ Binder . on ( 'click' , elements [ i ] , this . click ) ;
3202
+ Binder . on ( 'touchstart' , elements [ i ] , this . click , capture ) ;
3206
3203
}
3207
3204
} ,
3208
3205
0 commit comments