Removed slide delay

This commit is contained in:
Max Lynch
2015-05-21 16:02:39 -05:00
parent f7ada85f60
commit e1f1de0e44

View File

@ -13,6 +13,22 @@ import {IonicComponent} from 'ionic/config/component'
import {Hammer} from 'ionic/gestures/hammer'; import {Hammer} from 'ionic/gestures/hammer';
/**
* Slides is a slide box implementation based off of swipe.js
* and the ionic1 implementation.
*
* May 21st, 2015
* @maxlynch
*
* * TODO: Finish the slideshow, should continue on transition end or a
* similar event.
* * TODO: Add support for 2 slide cloning
* * TODO: Test support for N-slide sliding (like go 2 slides ahead)
* * TODO: Analyze performance, add request animation frame if necessary
* * TODO: Test mouse support
* * TODO: Port over mouse handling
*/
@Component({ @Component({
selector: 'ion-slides' selector: 'ion-slides'
}) })
@ -30,7 +46,7 @@ export class Slides {
this.slides = []; this.slides = [];
this.currentIndex = 0; this.currentIndex = 0;
this.animateSpeed = 300; this.animateSpeed = 300;
this.slideDelay = 0;//3000;
// Initialize our slides gesture handler // Initialize our slides gesture handler
this.gesture = new SlidesGesture(this); this.gesture = new SlidesGesture(this);
@ -43,9 +59,27 @@ export class Slides {
this.wrapperElement = this.domElement.children[0]; this.wrapperElement = this.domElement.children[0];
this.resize(); this.resize();
if(this.slideDelay) {
this.startShow();
}
}); });
} }
/**
* Start the slideshow.
*/
startShow() {
this._showTimeout = setTimeout(this.slideRight.bind(this), this.slideDelay);
}
/**
* End the slideshow.
*/
stopShow() {
clearTimeout(this._showTimout);
}
setPager(pager) { setPager(pager) {
this._pager = pager; this._pager = pager;
} }