Skip to content

Commit 9bab3c8

Browse files
chore(): Dump v3.2.0 and build destination files
1 parent 95d857b commit 9bab3c8

File tree

5 files changed

+60
-42
lines changed

5 files changed

+60
-42
lines changed

dist/glide.esm.js

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Glide.js v3.1.0
2+
* Glide.js v3.2.0
33
* (c) 2013-2018 Jędrzej Chałubek <[email protected]> (http://jedrzejchalubek.com/)
44
* Released under the MIT License.
55
*/
@@ -566,7 +566,7 @@ var Glide = function () {
566566
classCallCheck(this, Glide);
567567

568568
this._c = {};
569-
this._m = [];
569+
this._t = [];
570570
this._e = new EventsBus();
571571

572572
this.disabled = false;
@@ -602,19 +602,19 @@ var Glide = function () {
602602
}
603603

604604
/**
605-
* Collects instance translate mutators.
605+
* Collects an instance `translate` transformers.
606606
*
607-
* @param {Array} mutators Collection of mutators.
607+
* @param {Array} transformers Collection of transformers.
608608
* @return {Void}
609609
*/
610610

611611
}, {
612612
key: 'mutate',
613613
value: function mutate() {
614-
var mutators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
614+
var transformers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
615615

616-
if (isArray(mutators)) {
617-
this._m = mutators;
616+
if (isArray(transformers)) {
617+
this._t = transformers;
618618
} else {
619619
warn('You need to provide a array on `mutate()`');
620620
}
@@ -2282,15 +2282,15 @@ function Focusing (Glide, Components) {
22822282
* @param {Object} Components
22832283
* @return {Object}
22842284
*/
2285-
function transformer (Glide, Components, Events) {
2285+
function mutator (Glide, Components, Events) {
22862286
/**
2287-
* Merge instance mutators with collection of default transformers.
2287+
* Merge instance transformers with collection of default transformers.
22882288
* It's important that the Rtl component be last on the list,
22892289
* so it reflects all previous transformations.
22902290
*
22912291
* @type {Array}
22922292
*/
2293-
var MUTATORS = [Gap, Grow, Peeking, Focusing].concat(Glide._m, [Rtl]);
2293+
var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide._t, [Rtl]);
22942294

22952295
return {
22962296
/**
@@ -2300,8 +2300,14 @@ function transformer (Glide, Components, Events) {
23002300
* @return {Number}
23012301
*/
23022302
mutate: function mutate(translate) {
2303-
for (var i = 0; i < MUTATORS.length; i++) {
2304-
translate = MUTATORS[i](Glide, Components, Events).modify(translate);
2303+
for (var i = 0; i < TRANSFORMERS.length; i++) {
2304+
var transformer = TRANSFORMERS[i];
2305+
2306+
if (isFunction(transformer) && isFunction(transformer().modify)) {
2307+
translate = transformer(Glide, Components, Events).modify(translate);
2308+
} else {
2309+
warn('Transformer should be a function that returns an object with `modify()` method');
2310+
}
23052311
}
23062312

23072313
return translate;
@@ -2318,7 +2324,7 @@ function Translate (Glide, Components, Events) {
23182324
* @return {Void}
23192325
*/
23202326
set: function set(value) {
2321-
var transform = transformer(Glide, Components).mutate(value);
2327+
var transform = mutator(Glide, Components).mutate(value);
23222328

23232329
Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';
23242330
},

dist/glide.js

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Glide.js v3.1.0
2+
* Glide.js v3.2.0
33
* (c) 2013-2018 Jędrzej Chałubek <[email protected]> (http://jedrzejchalubek.com/)
44
* Released under the MIT License.
55
*/
@@ -572,7 +572,7 @@
572572
classCallCheck(this, Glide);
573573

574574
this._c = {};
575-
this._m = [];
575+
this._t = [];
576576
this._e = new EventsBus();
577577

578578
this.disabled = false;
@@ -608,19 +608,19 @@
608608
}
609609

610610
/**
611-
* Collects instance translate mutators.
611+
* Collects an instance `translate` transformers.
612612
*
613-
* @param {Array} mutators Collection of mutators.
613+
* @param {Array} transformers Collection of transformers.
614614
* @return {Void}
615615
*/
616616

617617
}, {
618618
key: 'mutate',
619619
value: function mutate() {
620-
var mutators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
620+
var transformers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
621621

622-
if (isArray(mutators)) {
623-
this._m = mutators;
622+
if (isArray(transformers)) {
623+
this._t = transformers;
624624
} else {
625625
warn('You need to provide a array on `mutate()`');
626626
}
@@ -2288,15 +2288,15 @@
22882288
* @param {Object} Components
22892289
* @return {Object}
22902290
*/
2291-
function transformer (Glide, Components, Events) {
2291+
function mutator (Glide, Components, Events) {
22922292
/**
2293-
* Merge instance mutators with collection of default transformers.
2293+
* Merge instance transformers with collection of default transformers.
22942294
* It's important that the Rtl component be last on the list,
22952295
* so it reflects all previous transformations.
22962296
*
22972297
* @type {Array}
22982298
*/
2299-
var MUTATORS = [Gap, Grow, Peeking, Focusing].concat(Glide._m, [Rtl]);
2299+
var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide._t, [Rtl]);
23002300

23012301
return {
23022302
/**
@@ -2306,8 +2306,14 @@
23062306
* @return {Number}
23072307
*/
23082308
mutate: function mutate(translate) {
2309-
for (var i = 0; i < MUTATORS.length; i++) {
2310-
translate = MUTATORS[i](Glide, Components, Events).modify(translate);
2309+
for (var i = 0; i < TRANSFORMERS.length; i++) {
2310+
var transformer = TRANSFORMERS[i];
2311+
2312+
if (isFunction(transformer) && isFunction(transformer().modify)) {
2313+
translate = transformer(Glide, Components, Events).modify(translate);
2314+
} else {
2315+
warn('Transformer should be a function that returns an object with `modify()` method');
2316+
}
23112317
}
23122318

23132319
return translate;
@@ -2324,7 +2330,7 @@
23242330
* @return {Void}
23252331
*/
23262332
set: function set(value) {
2327-
var transform = transformer(Glide, Components).mutate(value);
2333+
var transform = mutator(Glide, Components).mutate(value);
23282334

23292335
Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';
23302336
},

0 commit comments

Comments
 (0)