Skip to content

Commit

Permalink
feat(tabs): update to latest Swiper
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Dec 16, 2022
1 parent b8dbe29 commit 1e82bf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/components/swiper/swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ function initSwiper(swiperEl) {
if (typeof params.initialSlide === 'undefined' && typeof initialSlide !== 'undefined') {
params.initialSlide = initialSlide;
}

const swiper = app.swiper.create($swiperEl[0], params);
function updateSwiper() {
swiper.update();
Expand Down Expand Up @@ -89,15 +88,15 @@ function initSwiper(swiperEl) {
let view = app.views.get($swiperEl.parents('.view'));
if (!view) view = app.views.main;
const router = view.router;
const tabRouteUrl = router.findTabRouteUrl(swiper.slides.eq(swiper.activeIndex)[0]);
const tabRouteUrl = router.findTabRouteUrl($(swiper.slides).eq(swiper.activeIndex)[0]);
if (tabRouteUrl) {
setTimeout(() => {
router.navigate(tabRouteUrl);
}, 0);
}
} else {
app.tab.show({
tabEl: swiper.slides.eq(swiper.activeIndex),
tabEl: $(swiper.slides).eq(swiper.activeIndex),
});
}
});
Expand Down
1 change: 1 addition & 0 deletions src/core/components/tabs/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
}
> .tabs > .tab {
display: block;
touch-action: pan-y;
}
}
.page > .tabs {
Expand Down

0 comments on commit 1e82bf4

Please sign in to comment.