GULP DIST
This commit is contained in:
29
dist/assets/vendor/swiper/modules/a11y/a11y.js
vendored
29
dist/assets/vendor/swiper/modules/a11y/a11y.js
vendored
@@ -111,7 +111,7 @@ export default function A11y({
|
||||
}
|
||||
|
||||
function updateNavigation() {
|
||||
if (swiper.params.loop || !swiper.navigation) return;
|
||||
if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
|
||||
const {
|
||||
$nextEl,
|
||||
$prevEl
|
||||
@@ -139,23 +139,34 @@ export default function A11y({
|
||||
}
|
||||
|
||||
function hasPagination() {
|
||||
return swiper.pagination && swiper.params.pagination.clickable && swiper.pagination.bullets && swiper.pagination.bullets.length;
|
||||
return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
|
||||
}
|
||||
|
||||
function hasClickablePagination() {
|
||||
return hasPagination() && swiper.params.pagination.clickable;
|
||||
}
|
||||
|
||||
function updatePagination() {
|
||||
const params = swiper.params.a11y;
|
||||
if (!hasPagination()) return;
|
||||
swiper.pagination.bullets.each(bulletEl => {
|
||||
const $bulletEl = $(bulletEl);
|
||||
|
||||
if (hasPagination()) {
|
||||
swiper.pagination.bullets.each(bulletEl => {
|
||||
const $bulletEl = $(bulletEl);
|
||||
if (swiper.params.pagination.clickable) {
|
||||
makeElFocusable($bulletEl);
|
||||
|
||||
if (!swiper.params.pagination.renderBullet) {
|
||||
addElRole($bulletEl, 'button');
|
||||
addElLabel($bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, $bulletEl.index() + 1));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if ($bulletEl.is(`.${swiper.params.pagination.bulletActiveClass}`)) {
|
||||
$bulletEl.attr('aria-current', 'true');
|
||||
} else {
|
||||
$bulletEl.removeAttr('aria-current');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const initNavEl = ($el, wrapperId, message) => {
|
||||
@@ -224,7 +235,7 @@ export default function A11y({
|
||||
} // Pagination
|
||||
|
||||
|
||||
if (hasPagination()) {
|
||||
if (hasClickablePagination()) {
|
||||
swiper.pagination.$el.on('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey);
|
||||
}
|
||||
}
|
||||
@@ -251,7 +262,7 @@ export default function A11y({
|
||||
} // Pagination
|
||||
|
||||
|
||||
if (hasPagination()) {
|
||||
if (hasClickablePagination()) {
|
||||
swiper.pagination.$el.off('keydown', classesToSelector(swiper.params.pagination.bulletClass), onEnterOrSpaceKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,19 +57,19 @@ export default function Navigation({
|
||||
$nextEl,
|
||||
$prevEl
|
||||
} = swiper.navigation;
|
||||
toggleEl($prevEl, swiper.isBeginning);
|
||||
toggleEl($nextEl, swiper.isEnd);
|
||||
toggleEl($prevEl, swiper.isBeginning && !swiper.params.rewind);
|
||||
toggleEl($nextEl, swiper.isEnd && !swiper.params.rewind);
|
||||
}
|
||||
|
||||
function onPrevClick(e) {
|
||||
e.preventDefault();
|
||||
if (swiper.isBeginning && !swiper.params.loop) return;
|
||||
if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return;
|
||||
swiper.slidePrev();
|
||||
}
|
||||
|
||||
function onNextClick(e) {
|
||||
e.preventDefault();
|
||||
if (swiper.isEnd && !swiper.params.loop) return;
|
||||
if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return;
|
||||
swiper.slideNext();
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ export default function Pagination({
|
||||
$el.css(swiper.isHorizontal() ? 'width' : 'height', `${bulletSize * (params.dynamicMainBullets + 4)}px`);
|
||||
|
||||
if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
|
||||
dynamicBulletIndex += current - swiper.previousIndex;
|
||||
dynamicBulletIndex += current - (swiper.previousIndex - swiper.loopedSlides || 0);
|
||||
|
||||
if (dynamicBulletIndex > params.dynamicMainBullets - 1) {
|
||||
dynamicBulletIndex = params.dynamicMainBullets - 1;
|
||||
@@ -105,7 +105,7 @@ export default function Pagination({
|
||||
}
|
||||
}
|
||||
|
||||
firstIndex = current - dynamicBulletIndex;
|
||||
firstIndex = Math.max(current - dynamicBulletIndex, 0);
|
||||
lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
|
||||
midIndex = (lastIndex + firstIndex) / 2;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export default function Pagination({
|
||||
}
|
||||
|
||||
if (swiper.params.loop) {
|
||||
if (bulletIndex >= bullets.length - params.dynamicMainBullets) {
|
||||
if (bulletIndex >= bullets.length) {
|
||||
for (let i = params.dynamicMainBullets; i >= 0; i -= 1) {
|
||||
bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user