Skip to content

Commit

Permalink
fix(slides): Updated lockSwipes methods to match the new swiper.js API (
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstelzer authored and manucorporat committed Sep 7, 2018
1 parent b362b0a commit efb99cb
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions core/src/components/slides/slides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,35 +235,25 @@ export class Slides {
*/
@Method()
lockSwipeToNext(shouldLockSwipeToNext: boolean) {
if (shouldLockSwipeToNext) {
this.swiper.lockSwipeToNext();
} else {
this.swiper.unlockSwipeToNext();
}
this.swiper.allowSlideNext = !shouldLockSwipeToNext;
}

/**
* Lock or unlock the ability to slide to the previous slides.
*/
@Method()
lockSwipeToPrev(shouldLockSwipeToPrev: boolean) {
if (shouldLockSwipeToPrev) {
this.swiper.lockSwipeToPrev();
} else {
this.swiper.unlockSwipeToPrev();
}
this.swiper.allowSlidePrev = !shouldLockSwipeToPrev;
}

/**
* Lock or unlock the ability to slide to change slides.
*/
@Method()
lockSwipes(shouldLockSwipes: boolean) {
if (shouldLockSwipes) {
this.swiper.lockSwipes();
} else {
this.swiper.unlockSwipes();
}
this.swiper.allowSlideNext = !shouldLockSwipes;
this.swiper.allowSlidePrev = !shouldLockSwipes;
this.swiper.allowTouchMove = !shouldLockSwipes;
}

private normalizeOptions() {
Expand Down

0 comments on commit efb99cb

Please sign in to comment.