Skip to content

Commit b1cb718

Browse files
Resolve a conflict with prototype.js using forEach instead of for-in(#27).
1 parent b68caef commit b1cb718

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

dist/js/splide.esm.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Splide.js
3-
* Version : 2.2.5
3+
* Version : 2.2.6
44
* License : MIT
55
* Copyright: 2020 Naotoshi Fujita
66
*/
@@ -4279,11 +4279,11 @@ var PAUSE_FLAGS = {
42794279

42804280

42814281
function switchOn(elms, event, flag, play) {
4282-
for (var i in elms) {
4282+
elms.forEach(function (elm) {
42834283
Splide.on(event, function () {
42844284
Autoplay[play ? 'play' : 'pause'](flag);
4285-
}, elms[i]);
4286-
}
4285+
}, elm);
4286+
});
42874287
}
42884288

42894289
return Autoplay;

dist/js/splide.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Splide.js
3-
* Version : 2.2.5
3+
* Version : 2.2.6
44
* License : MIT
55
* Copyright: 2020 Naotoshi Fujita
66
*/
@@ -4269,11 +4269,11 @@ var PAUSE_FLAGS = {
42694269

42704270

42714271
function switchOn(elms, event, flag, play) {
4272-
for (var i in elms) {
4272+
elms.forEach(function (elm) {
42734273
Splide.on(event, function () {
42744274
Autoplay[play ? 'play' : 'pause'](flag);
4275-
}, elms[i]);
4276-
}
4275+
}, elm);
4276+
});
42774277
}
42784278

42794279
return Autoplay;

dist/js/splide.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/splide.min.js.gz

-8 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splidejs/splide",
3-
"version": "2.2.5",
3+
"version": "2.2.6",
44
"description": "Splide is a lightweight and powerful slider without any dependencies.",
55
"author": "Naotoshi Fujita",
66
"license": "MIT",

src/js/components/autoplay/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ export default ( Splide, Components, name ) => {
155155
* @param {boolean} play - Determine whether to play or pause.
156156
*/
157157
function switchOn( elms, event, flag, play ) {
158-
for ( let i in elms ) {
159-
Splide.on( event, () => { Autoplay[ play ? 'play' : 'pause' ]( flag ) }, elms[ i ] );
160-
}
158+
elms.forEach( elm => {
159+
Splide.on( event, () => { Autoplay[ play ? 'play' : 'pause' ]( flag ) }, elm );
160+
} );
161161
}
162162

163163
return Autoplay;

0 commit comments

Comments
 (0)