From 0c4e31d9ae3c2ec0bbcfecf716acac60f8db63ba Mon Sep 17 00:00:00 2001 From: "ciprian.mocanu" Date: Sun, 15 Jan 2017 13:05:03 +0100 Subject: [PATCH] Adapted it for Ionic RC5 --- package.json | 2 +- src/gallery-modal/gallery-modal.html | 3 ++- src/gallery-modal/gallery-modal.ts | 11 ++--------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 34904e7..8ee6689 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ionic-gallery-modal", - "version": "0.0.7", + "version": "0.0.8", "description": "Ionic 2 Gallery Modal (to preview photos)", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/gallery-modal/gallery-modal.html b/src/gallery-modal/gallery-modal.html index 0d52749..f884a6e 100644 --- a/src/gallery-modal/gallery-modal.html +++ b/src/gallery-modal/gallery-modal.html @@ -9,10 +9,11 @@ - + = new Subject(); @@ -26,7 +24,6 @@ export class GalleryModal { this.photos = params.get('photos') || []; this.closeIcon = params.get('closeIcon') || 'arrow-back'; this.initialSlide = params.get('initialSlide') || 0; - this.slideOptions.initialSlide = this.initialSlide; } /** @@ -70,9 +67,7 @@ export class GalleryModal { */ private disableScroll(event) { if (!this.sliderDisabled) { - this.swiper = this.slider.getSlider(); - this.currentSlide = this.swiper.activeIndex; - this.swiper.destroy(false); + this.currentSlide = this.slider.getActiveIndex(); this.sliderDisabled = true; } } @@ -84,9 +79,7 @@ export class GalleryModal { */ private enableScroll(event) { if (this.sliderDisabled) { - this.swiper = this.slider.getSlider(); - this.swiper.init(); - this.swiper.slideTo(this.currentSlide, 0, false); + this.slider.slideTo(this.currentSlide, 0, false); this.sliderDisabled = false; } }