This commit is contained in:
Max Lynch
2015-08-31 16:07:56 -05:00
parent dbd3cadc26
commit bff72a20dc
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
<ion-slides>
<ion-slides bounce="false">
<ion-slide>

View File

@ -32,7 +32,7 @@ import {Swiper} from './swiper-widget';
'loop',
'index',
'bounce',
'hidePager',
'showPager',
'options'
]
})
@ -41,7 +41,7 @@ import {Swiper} from './swiper-widget';
<div class="swiper-wrapper">
<ng-content></ng-content>
</div>
<div [class.hide]="hidePager" class="swiper-pagination"></div>
<div [class.hide]="!showPager" class="swiper-pagination"></div>
</div>`,
directives: [NgIf, NgClass]
})
@ -54,12 +54,16 @@ export class Slides extends Ion {
super(elementRef, config);
}
onInit() {
console.log(this.bounce);
var options = util.defaults({
pagination: '.swiper-pagination',
paginationClickable: true,
lazyLoading: true
lazyLoading: true,
//resistance: (this.bounce !== "false")
}, this.options);
console.log(options);
var swiper = new Swiper(this.getNativeElement().children[0], options);
this.swiper = swiper;
@ -72,8 +76,10 @@ export class Slides extends Ion {
update() {
setTimeout(() => {
this.swiper.update();
// Don't allow pager to show with > 10 slides
if(this.swiper.slides.length > 10) {
this.hidePager = true;
this.showPager = false;
}
});
}