Skip to content

Commit

Permalink
chore(): Bump v3.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Mar 22, 2019
1 parent 4fc497e commit e957e27
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 93 deletions.
57 changes: 27 additions & 30 deletions dist/glide.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Glide.js v3.2.6
* Glide.js v3.2.7
* (c) 2013-2019 Jędrzej Chałubek <[email protected]> (http://jedrzejchalubek.com/)
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2547,7 +2547,6 @@ function Swipe (Glide, Components, Events) {
var swipeStartX = 0;
var swipeStartY = 0;
var disabled = false;
var moveable = true;
var capture = supportsPassive$1 ? { passive: true } : false;

var Swipe = {
Expand All @@ -2573,7 +2572,6 @@ function Swipe (Glide, Components, Events) {

var swipe = this.touches(event);

moveable = true;
swipeSin = null;
swipeStartX = toInt(swipe.pageX);
swipeStartY = toInt(swipe.pageY);
Expand Down Expand Up @@ -2610,7 +2608,7 @@ function Swipe (Glide, Components, Events) {

swipeSin = Math.asin(swipeCathetus / swipeHypotenuse);

if (moveable && swipeSin * 180 / Math.PI < touchAngle) {
if (swipeSin * 180 / Math.PI < touchAngle) {
event.stopPropagation();

Components.Move.make(subExSx * toFloat(touchRatio));
Expand All @@ -2619,8 +2617,6 @@ function Swipe (Glide, Components, Events) {

Events.emit('swipe.move');
} else {
moveable = false;

return false;
}
}
Expand All @@ -2646,33 +2642,31 @@ function Swipe (Glide, Components, Events) {

this.enable();

if (moveable) {
if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {
// While swipe is positive and greater than threshold move backward.
if (settings.perTouch) {
steps = Math.min(steps, toInt(settings.perTouch));
}

if (Components.Direction.is('rtl')) {
steps = -steps;
}
if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {
// While swipe is positive and greater than threshold move backward.
if (settings.perTouch) {
steps = Math.min(steps, toInt(settings.perTouch));
}

Components.Run.make(Components.Direction.resolve('<' + steps));
} else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {
// While swipe is negative and lower than negative threshold move forward.
if (settings.perTouch) {
steps = Math.max(steps, -toInt(settings.perTouch));
}
if (Components.Direction.is('rtl')) {
steps = -steps;
}

if (Components.Direction.is('rtl')) {
steps = -steps;
}
Components.Run.make(Components.Direction.resolve('<' + steps));
} else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {
// While swipe is negative and lower than negative threshold move forward.
if (settings.perTouch) {
steps = Math.max(steps, -toInt(settings.perTouch));
}

Components.Run.make(Components.Direction.resolve('>' + steps));
} else {
// While swipe don't reach distance apply previous transform.
Components.Move.make();
if (Components.Direction.is('rtl')) {
steps = -steps;
}

Components.Run.make(Components.Direction.resolve('>' + steps));
} else {
// While swipe don't reach distance apply previous transform.
Components.Move.make();
}

Components.Html.root.classList.remove(settings.classes.dragging);
Expand Down Expand Up @@ -3087,6 +3081,8 @@ function Controls (Glide, Components, Events) {
*/
var Binder = new EventsBinder();

var capture = supportsPassive$1 ? { passive: true } : false;

var Controls = {
/**
* Inits arrows. Binds events listeners
Expand Down Expand Up @@ -3202,7 +3198,8 @@ function Controls (Glide, Components, Events) {
*/
bind: function bind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.on(['click', 'touchstart'], elements[i], this.click);
Binder.on('click', elements[i], this.click);
Binder.on('touchstart', elements[i], this.click, capture);
}
},

Expand Down
57 changes: 27 additions & 30 deletions dist/glide.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Glide.js v3.2.6
* Glide.js v3.2.7
* (c) 2013-2019 Jędrzej Chałubek <[email protected]> (http://jedrzejchalubek.com/)
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2553,7 +2553,6 @@
var swipeStartX = 0;
var swipeStartY = 0;
var disabled = false;
var moveable = true;
var capture = supportsPassive$1 ? { passive: true } : false;

var Swipe = {
Expand All @@ -2579,7 +2578,6 @@

var swipe = this.touches(event);

moveable = true;
swipeSin = null;
swipeStartX = toInt(swipe.pageX);
swipeStartY = toInt(swipe.pageY);
Expand Down Expand Up @@ -2616,7 +2614,7 @@

swipeSin = Math.asin(swipeCathetus / swipeHypotenuse);

if (moveable && swipeSin * 180 / Math.PI < touchAngle) {
if (swipeSin * 180 / Math.PI < touchAngle) {
event.stopPropagation();

Components.Move.make(subExSx * toFloat(touchRatio));
Expand All @@ -2625,8 +2623,6 @@

Events.emit('swipe.move');
} else {
moveable = false;

return false;
}
}
Expand All @@ -2652,33 +2648,31 @@

this.enable();

if (moveable) {
if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {
// While swipe is positive and greater than threshold move backward.
if (settings.perTouch) {
steps = Math.min(steps, toInt(settings.perTouch));
}

if (Components.Direction.is('rtl')) {
steps = -steps;
}
if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {
// While swipe is positive and greater than threshold move backward.
if (settings.perTouch) {
steps = Math.min(steps, toInt(settings.perTouch));
}

Components.Run.make(Components.Direction.resolve('<' + steps));
} else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {
// While swipe is negative and lower than negative threshold move forward.
if (settings.perTouch) {
steps = Math.max(steps, -toInt(settings.perTouch));
}
if (Components.Direction.is('rtl')) {
steps = -steps;
}

if (Components.Direction.is('rtl')) {
steps = -steps;
}
Components.Run.make(Components.Direction.resolve('<' + steps));
} else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {
// While swipe is negative and lower than negative threshold move forward.
if (settings.perTouch) {
steps = Math.max(steps, -toInt(settings.perTouch));
}

Components.Run.make(Components.Direction.resolve('>' + steps));
} else {
// While swipe don't reach distance apply previous transform.
Components.Move.make();
if (Components.Direction.is('rtl')) {
steps = -steps;
}

Components.Run.make(Components.Direction.resolve('>' + steps));
} else {
// While swipe don't reach distance apply previous transform.
Components.Move.make();
}

Components.Html.root.classList.remove(settings.classes.dragging);
Expand Down Expand Up @@ -3093,6 +3087,8 @@
*/
var Binder = new EventsBinder();

var capture = supportsPassive$1 ? { passive: true } : false;

var Controls = {
/**
* Inits arrows. Binds events listeners
Expand Down Expand Up @@ -3208,7 +3204,8 @@
*/
bind: function bind(elements) {
for (var i = 0; i < elements.length; i++) {
Binder.on(['click', 'touchstart'], elements[i], this.click);
Binder.on('click', elements[i], this.click);
Binder.on('touchstart', elements[i], this.click, capture);
}
},

Expand Down
Loading

0 comments on commit e957e27

Please sign in to comment.