Permalink
Browse files

4.3.2 Release

  • Loading branch information...
nolimits4web committed Jun 1, 2018
1 parent 55e4149 commit 3eea2a0b2d558ea410876b264526b801fdf8afae
@@ -1,10 +1,19 @@
# Change Log
## [Swiper 4.3.0](https://github.com/nolimits4web/swiper/compare/v4.2.6...v4.3.0) - Released on May 1, 2018
## [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
* Fixed issue with loop #2647. Thanks to @kochizufan
* Pagination
* New `formatFractionCurrent(number)` parameter to format current number in Fraction pagination
* New `formatFractionTotal(number)` parameter to format total number in Fraction pagination
* Minor fixes
## [Swiper 4.3.0](https://github.com/nolimits4web/swiper/compare/v4.2.6...v4.3.0) - Released on May 27, 2018
* Core
* Fixed issue when `swipeBack` sometimes slides to wrong slide
* Fixed issue when window resizing can break Coverflow effect layout
* Fixed issue with wrong detection of iOSEdgeSwipeDetection
* Fixed issue with wrong detection of `iOSEdgeSwipeDetection`. Thanks to @langjun
* Dom7 update to latest v2.0.6:
* Fixed issue with remove event listeners when they was not added
* Minor fixes
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.0
* Swiper 4.3.2
* 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: May 27, 2018
* Released on: June 1, 2018
*/
.swiper-container {
margin: 0 auto;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.0
* Swiper 4.3.2
* 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: May 27, 2018
* Released on: June 1, 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';
@@ -413,8 +413,9 @@ function updateSlides () {
const {
$wrapperEl, size: swiperSize, rtlTranslate: rtl, wrongRTL,
} = swiper;
const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
const isVirtual = swiper.virtual && params.virtual.enabled;
const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
let snapGrid = [];
const slidesGrid = [];
@@ -430,7 +431,6 @@ function updateSlides () {
offsetAfter = params.slidesOffsetAfter.call(swiper);
}
const previousSlidesLength = slidesLength;
const previousSnapGridLength = swiper.snapGrid.length;
const previousSlidesGridLength = swiper.snapGrid.length;
@@ -1366,7 +1366,7 @@ function loopFix () {
if (slideChanged && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
} else if ((params.slidesPerView === 'auto' && activeIndex >= loopedSlides * 2) || (activeIndex > slides.length - (params.slidesPerView * 2))) {
} else if ((params.slidesPerView === 'auto' && activeIndex >= loopedSlides * 2) || (activeIndex >= slides.length - loopedSlides)) {
// Fix For Positive Oversliding
newIndex = -slides.length + activeIndex + loopedSlides;
newIndex += loopedSlides;
@@ -1459,15 +1459,69 @@ function prependSlide (slides) {
swiper.slideTo(newActiveIndex, 0, false);
}
function addSlide (index$$1, slides) {
const swiper = this;
const { $wrapperEl, params, activeIndex } = swiper;
let activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
}
const baseLength = swiper.slides.length;
if (index$$1 <= 0) {
swiper.prependSlide(slides);
return;
} else if (index$$1 >= baseLength) {
swiper.appendSlide(slides);
return;
}
let newActiveIndex = activeIndexBuffer > index$$1 ? activeIndexBuffer + 1 : activeIndexBuffer;
const slidesBuffer = [];
for (let i = baseLength - 1; i >= index$$1; i -= 1) {
const currentSlide = swiper.slides.eq(i);
currentSlide.remove();
slidesBuffer.unshift(currentSlide);
}
if (typeof slides === 'object' && 'length' in slides) {
for (let i = 0; i < slides.length; i += 1) {
if (slides[i]) $wrapperEl.append(slides[i]);
}
newActiveIndex = activeIndexBuffer > index$$1 ? activeIndexBuffer + slides.length : activeIndexBuffer;
} else {
$wrapperEl.append(slides);
}
for (let i = 0; i < slidesBuffer.length; i += 1) {
$wrapperEl.append(slidesBuffer[i]);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
function removeSlide (slidesIndexes) {
const swiper = this;
const { params, $wrapperEl, activeIndex } = swiper;
let activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
}
let newActiveIndex = activeIndex;
let newActiveIndex = activeIndexBuffer;
let indexToRemove;
if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
@@ -1511,6 +1565,7 @@ function removeAllSlides () {
var manipulation = {
appendSlide,
prependSlide,
addSlide,
removeSlide,
removeAllSlides,
};
@@ -3958,8 +4013,8 @@ const Pagination = {
}
}
if (params.type === 'fraction') {
$el.find(`.${params.currentClass}`).text(current + 1);
$el.find(`.${params.totalClass}`).text(total);
$el.find(`.${params.currentClass}`).text(params.formatFractionCurrent(current + 1));
$el.find(`.${params.totalClass}`).text(params.formatFractionTotal(total));
}
if (params.type === 'progressbar') {
let progressbarDirection;
@@ -4109,6 +4164,8 @@ var Pagination$1 = {
type: 'bullets', // 'bullets' or 'progressbar' or 'fraction' or 'custom'
dynamicBullets: false,
dynamicMainBullets: 1,
formatFractionCurrent: number => number,
formatFractionTotal: number => number,
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
modifierClass: 'swiper-pagination-', // NEW
@@ -1,13 +1,13 @@
/**
* Swiper 4.3.0
* Swiper 4.3.2
* 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: May 27, 2018
* Released on: June 1, 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';
@@ -413,8 +413,9 @@ function updateSlides () {
const {
$wrapperEl, size: swiperSize, rtlTranslate: rtl, wrongRTL,
} = swiper;
const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
const isVirtual = swiper.virtual && params.virtual.enabled;
const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
let snapGrid = [];
const slidesGrid = [];
@@ -430,7 +431,6 @@ function updateSlides () {
offsetAfter = params.slidesOffsetAfter.call(swiper);
}
const previousSlidesLength = slidesLength;
const previousSnapGridLength = swiper.snapGrid.length;
const previousSlidesGridLength = swiper.snapGrid.length;
@@ -1366,7 +1366,7 @@ function loopFix () {
if (slideChanged && diff !== 0) {
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
}
} else if ((params.slidesPerView === 'auto' && activeIndex >= loopedSlides * 2) || (activeIndex > slides.length - (params.slidesPerView * 2))) {
} else if ((params.slidesPerView === 'auto' && activeIndex >= loopedSlides * 2) || (activeIndex >= slides.length - loopedSlides)) {
// Fix For Positive Oversliding
newIndex = -slides.length + activeIndex + loopedSlides;
newIndex += loopedSlides;
@@ -1459,15 +1459,69 @@ function prependSlide (slides) {
swiper.slideTo(newActiveIndex, 0, false);
}
function addSlide (index$$1, slides) {
const swiper = this;
const { $wrapperEl, params, activeIndex } = swiper;
let activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
}
const baseLength = swiper.slides.length;
if (index$$1 <= 0) {
swiper.prependSlide(slides);
return;
} else if (index$$1 >= baseLength) {
swiper.appendSlide(slides);
return;
}
let newActiveIndex = activeIndexBuffer > index$$1 ? activeIndexBuffer + 1 : activeIndexBuffer;
const slidesBuffer = [];
for (let i = baseLength - 1; i >= index$$1; i -= 1) {
const currentSlide = swiper.slides.eq(i);
currentSlide.remove();
slidesBuffer.unshift(currentSlide);
}
if (typeof slides === 'object' && 'length' in slides) {
for (let i = 0; i < slides.length; i += 1) {
if (slides[i]) $wrapperEl.append(slides[i]);
}
newActiveIndex = activeIndexBuffer > index$$1 ? activeIndexBuffer + slides.length : activeIndexBuffer;
} else {
$wrapperEl.append(slides);
}
for (let i = 0; i < slidesBuffer.length; i += 1) {
$wrapperEl.append(slidesBuffer[i]);
}
if (params.loop) {
swiper.loopCreate();
}
if (!(params.observer && Support.observer)) {
swiper.update();
}
if (params.loop) {
swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
} else {
swiper.slideTo(newActiveIndex, 0, false);
}
}
function removeSlide (slidesIndexes) {
const swiper = this;
const { params, $wrapperEl, activeIndex } = swiper;
let activeIndexBuffer = activeIndex;
if (params.loop) {
activeIndexBuffer -= swiper.loopedSlides;
swiper.loopDestroy();
swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
}
let newActiveIndex = activeIndex;
let newActiveIndex = activeIndexBuffer;
let indexToRemove;
if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
@@ -1511,6 +1565,7 @@ function removeAllSlides () {
var manipulation = {
appendSlide,
prependSlide,
addSlide,
removeSlide,
removeAllSlides,
};
@@ -3958,8 +4013,8 @@ const Pagination = {
}
}
if (params.type === 'fraction') {
$el.find(`.${params.currentClass}`).text(current + 1);
$el.find(`.${params.totalClass}`).text(total);
$el.find(`.${params.currentClass}`).text(params.formatFractionCurrent(current + 1));
$el.find(`.${params.totalClass}`).text(params.formatFractionTotal(total));
}
if (params.type === 'progressbar') {
let progressbarDirection;
@@ -4109,6 +4164,8 @@ var pagination = {
type: 'bullets', // 'bullets' or 'progressbar' or 'fraction' or 'custom'
dynamicBullets: false,
dynamicMainBullets: 1,
formatFractionCurrent: number => number,
formatFractionTotal: number => number,
bulletClass: 'swiper-pagination-bullet',
bulletActiveClass: 'swiper-pagination-bullet-active',
modifierClass: 'swiper-pagination-', // NEW
Oops, something went wrong.

0 comments on commit 3eea2a0

Please sign in to comment.