Permalink
Browse files

4.3.3 release

  • Loading branch information...
nolimits4web committed Jun 5, 2018
1 parent e5c6f3a commit 0dcd6cabf4b356dd3126185f288f729913e81aad
Showing with 75 additions and 39 deletions.
  1. +6 −0 CHANGELOG.md
  2. +2 −2 dist/css/swiper.css
  3. +2 −2 dist/css/swiper.min.css
  4. +20 −10 dist/js/swiper.esm.bundle.js
  5. +20 −10 dist/js/swiper.esm.js
  6. +20 −10 dist/js/swiper.js
  7. +3 −3 dist/js/swiper.min.js
  8. +1 −1 dist/js/swiper.min.js.map
  9. +1 −1 package.json
@@ -1,5 +1,11 @@
# Change Log
## [Swiper 4.3.3](https://github.com/nolimits4web/swiper/compare/v4.3.2...v4.3.3) - Released on June 5, 2018
* Core
* Fixed issue when slidePrev goes to wrong slide #2650
* Fixed issue when roundLength was not considered for grids calculation #2656
* Fixed typo in API #2659
## [Swiper 4.3.2](https://github.com/nolimits4web/swiper/compare/v4.3.0...v4.3.2) - Released on June 1, 2018
* Core
* Added `addSlide(index, slide)` method to add slide at required position. Thanks to @kochizufan
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.2
* Swiper 4.3.3
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2018 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: June 1, 2018
* Released on: June 5, 2018
*/
.swiper-container {
margin: 0 auto;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.2
* Swiper 4.3.3
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2018 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: June 1, 2018
* Released on: June 5, 2018
*/
import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, data, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, remove, add, styles } from 'dom7/dist/dom7.modular';
@@ -558,9 +558,11 @@ function updateSlides () {
if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
if (i === 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if ((index$$1) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
} else {
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if ((index$$1) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
slidePosition = slidePosition + slideSize + spaceBetween;
@@ -592,7 +594,9 @@ function updateSlides () {
if (params.centeredSlides) {
newSlidesGrid = [];
for (let i = 0; i < snapGrid.length; i += 1) {
if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(snapGrid[i]);
let slidesGridItem = snapGrid[i];
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
}
snapGrid = newSlidesGrid;
}
@@ -602,8 +606,10 @@ function updateSlides () {
if (!params.centeredSlides) {
newSlidesGrid = [];
for (let i = 0; i < snapGrid.length; i += 1) {
let slidesGridItem = snapGrid[i];
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
newSlidesGrid.push(snapGrid[i]);
newSlidesGrid.push(slidesGridItem);
}
}
snapGrid = newSlidesGrid;
@@ -962,7 +968,7 @@ function setTranslate (translate, byController) {
if (Support.transforms3d) $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);
else $wrapperEl.transform(`translate(${x}px, ${y}px)`);
}
swiper.previousTranslate = swiper.translate;
swiper.translate = swiper.isHorizontal() ? x : y;
// Check if we need to update progress
@@ -1206,10 +1212,13 @@ function slidePrev (speed = this.params.speed, runCallbacks = true, internal) {
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
const translate = rtlTranslate ? swiper.translate : -swiper.translate;
const normalizedTranslate = translate < 0 ? -Math.floor(Math.abs(translate)) : Math.floor(translate);
const normalizedSnapGrid = snapGrid.map(val => Math.floor(val));
const normalizedSlidesGrid = slidesGrid.map(val => Math.floor(val));
function normalize(val) {
if (val < 0) return -Math.floor(Math.abs(val));
return Math.floor(val);
}
const normalizedTranslate = normalize(translate);
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
const normalizedSlidesGrid = slidesGrid.map(val => normalize(val));
const currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
const prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
@@ -2797,6 +2806,7 @@ class Swiper extends SwiperClass {
// Props
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: false,
@@ -3688,7 +3698,7 @@ const Mousewheel = {
swiper.emit('scroll', e);
// Stop autoplay
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.stopAutoplay();
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();
// Return page scroll on edge positions
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true;
}
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.2
* Swiper 4.3.3
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2018 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: June 1, 2018
* Released on: June 5, 2018
*/
import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, data, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, remove, add, styles } from 'dom7/dist/dom7.modular';
@@ -558,9 +558,11 @@ function updateSlides () {
if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
if (i === 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if ((index$$1) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
} else {
if (params.roundLengths) slidePosition = Math.floor(slidePosition);
if ((index$$1) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
slidesGrid.push(slidePosition);
slidePosition = slidePosition + slideSize + spaceBetween;
@@ -592,7 +594,9 @@ function updateSlides () {
if (params.centeredSlides) {
newSlidesGrid = [];
for (let i = 0; i < snapGrid.length; i += 1) {
if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(snapGrid[i]);
let slidesGridItem = snapGrid[i];
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
}
snapGrid = newSlidesGrid;
}
@@ -602,8 +606,10 @@ function updateSlides () {
if (!params.centeredSlides) {
newSlidesGrid = [];
for (let i = 0; i < snapGrid.length; i += 1) {
let slidesGridItem = snapGrid[i];
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
newSlidesGrid.push(snapGrid[i]);
newSlidesGrid.push(slidesGridItem);
}
}
snapGrid = newSlidesGrid;
@@ -962,7 +968,7 @@ function setTranslate (translate, byController) {
if (Support.transforms3d) $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);
else $wrapperEl.transform(`translate(${x}px, ${y}px)`);
}
swiper.previousTranslate = swiper.translate;
swiper.translate = swiper.isHorizontal() ? x : y;
// Check if we need to update progress
@@ -1206,10 +1212,13 @@ function slidePrev (speed = this.params.speed, runCallbacks = true, internal) {
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
const translate = rtlTranslate ? swiper.translate : -swiper.translate;
const normalizedTranslate = translate < 0 ? -Math.floor(Math.abs(translate)) : Math.floor(translate);
const normalizedSnapGrid = snapGrid.map(val => Math.floor(val));
const normalizedSlidesGrid = slidesGrid.map(val => Math.floor(val));
function normalize(val) {
if (val < 0) return -Math.floor(Math.abs(val));
return Math.floor(val);
}
const normalizedTranslate = normalize(translate);
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
const normalizedSlidesGrid = slidesGrid.map(val => normalize(val));
const currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
const prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
@@ -2797,6 +2806,7 @@ class Swiper extends SwiperClass {
// Props
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: false,
@@ -3688,7 +3698,7 @@ const Mousewheel = {
swiper.emit('scroll', e);
// Stop autoplay
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.stopAutoplay();
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();
// Return page scroll on edge positions
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true;
}
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.2
* Swiper 4.3.3
* Most modern mobile touch slider and framework with hardware accelerated transitions
* http://www.idangero.us/swiper/
*
* Copyright 2014-2018 Vladimir Kharlampidi
*
* Released under the MIT License
*
* Released on: June 1, 2018
* Released on: June 5, 2018
*/
(function (global, factory) {
@@ -1428,9 +1428,11 @@
if (prevSlideSize === 0 && i !== 0) { slidePosition = slidePosition - (swiperSize / 2) - spaceBetween; }
if (i === 0) { slidePosition = slidePosition - (swiperSize / 2) - spaceBetween; }
if (Math.abs(slidePosition) < 1 / 1000) { slidePosition = 0; }
if (params.roundLengths) { slidePosition = Math.floor(slidePosition); }
if ((index) % params.slidesPerGroup === 0) { snapGrid.push(slidePosition); }
slidesGrid.push(slidePosition);
} else {
if (params.roundLengths) { slidePosition = Math.floor(slidePosition); }
if ((index) % params.slidesPerGroup === 0) { snapGrid.push(slidePosition); }
slidesGrid.push(slidePosition);
slidePosition = slidePosition + slideSize + spaceBetween;
@@ -1462,7 +1464,9 @@
if (params.centeredSlides) {
newSlidesGrid = [];
for (var i$1 = 0; i$1 < snapGrid.length; i$1 += 1) {
if (snapGrid[i$1] < swiper.virtualSize + snapGrid[0]) { newSlidesGrid.push(snapGrid[i$1]); }
var slidesGridItem = snapGrid[i$1];
if (params.roundLengths) { slidesGridItem = Math.floor(slidesGridItem); }
if (snapGrid[i$1] < swiper.virtualSize + snapGrid[0]) { newSlidesGrid.push(slidesGridItem); }
}
snapGrid = newSlidesGrid;
}
@@ -1472,8 +1476,10 @@
if (!params.centeredSlides) {
newSlidesGrid = [];
for (var i$2 = 0; i$2 < snapGrid.length; i$2 += 1) {
var slidesGridItem$1 = snapGrid[i$2];
if (params.roundLengths) { slidesGridItem$1 = Math.floor(slidesGridItem$1); }
if (snapGrid[i$2] <= swiper.virtualSize - swiperSize) {
newSlidesGrid.push(snapGrid[i$2]);
newSlidesGrid.push(slidesGridItem$1);
}
}
snapGrid = newSlidesGrid;
@@ -1848,7 +1854,7 @@
if (Support.transforms3d) { $wrapperEl.transform(("translate3d(" + x + "px, " + y + "px, " + z + "px)")); }
else { $wrapperEl.transform(("translate(" + x + "px, " + y + "px)")); }
}
swiper.previousTranslate = swiper.translate;
swiper.translate = swiper.isHorizontal() ? x : y;
// Check if we need to update progress
@@ -2119,10 +2125,13 @@
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
}
var translate = rtlTranslate ? swiper.translate : -swiper.translate;
var normalizedTranslate = translate < 0 ? -Math.floor(Math.abs(translate)) : Math.floor(translate);
var normalizedSnapGrid = snapGrid.map(function (val) { return Math.floor(val); });
var normalizedSlidesGrid = slidesGrid.map(function (val) { return Math.floor(val); });
function normalize(val) {
if (val < 0) { return -Math.floor(Math.abs(val)); }
return Math.floor(val);
}
var normalizedTranslate = normalize(translate);
var normalizedSnapGrid = snapGrid.map(function (val) { return normalize(val); });
var normalizedSlidesGrid = slidesGrid.map(function (val) { return normalize(val); });
var currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
@@ -3750,6 +3759,7 @@
// Props
translate: 0,
previousTranslate: 0,
progress: 0,
velocity: 0,
animating: false,
@@ -4660,7 +4670,7 @@
swiper.emit('scroll', e);
// Stop autoplay
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) { swiper.stopAutoplay(); }
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) { swiper.autoplay.stop(); }
// Return page scroll on edge positions
if (position === swiper.minTranslate() || position === swiper.maxTranslate()) { return true; }
}

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,6 +1,6 @@
{
"name": "swiper",
"version": "4.3.2",
"version": "4.3.3",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"main": "dist/js/swiper.js",
"jsnext:main": "dist/js/swiper.esm.bundle.js",

0 comments on commit 0dcd6ca

Please sign in to comment.