fix(aside): Flicker. Fixes #82

This commit is contained in:
Max Lynch
2015-09-02 17:11:44 -05:00
parent b2555666f9
commit 53210d2d0b
3 changed files with 29 additions and 9 deletions

View File

@@ -45,6 +45,10 @@ $aside-shadow: -1px 0px 8px rgba(0, 0, 0, 0.2) !default;
&[type=reveal] {
left: 0;
&:not(.open):not(.changing) {
display: none;
}
}
&.open, {

View File

@@ -1,4 +1,5 @@
import {Aside} from 'ionic/components/aside/aside';
import {Animtion} from 'ionic/aside/aside';
import {CSS} from 'ionic/util/dom'
// TODO use setters instead of direct dom manipulation
@@ -110,7 +111,7 @@ export class AsideTypeReveal extends AsideType {
contentManipulator.setSliding.call(this, sliding);
}
setOpen(sliding) {
console.log('Reveal setting open', sliding);
asideManipulator.setOpen.call(this, sliding);
contentManipulator.setOpen.call(this, sliding);
}
setTransform(t) {

View File

@@ -114,7 +114,7 @@ export class Slides extends Ion {
var swiper = new Swiper(this.getNativeElement().children[0], options);
this.swiper = swiper;
this.slider = swiper;
/*
* TODO: Finish this
@@ -158,8 +158,6 @@ export class Slides extends Ion {
this.zoomElement && this.zoomElement.classList.add('ion-scroll-zoom');
console.log(this.swiper.slides);
this.zoomGesture = new Gesture(this.zoomElement);
this.zoomGesture.listen();
@@ -303,10 +301,8 @@ export class Slides extends Ion {
}
}
onTransitionStart(swiper) {
console.log('Slide transition start', swiper);
}
onTransitionEnd(swiper) {
console.log('Slide transition end', swiper);
}
onTouchStart(e) {
@@ -416,17 +412,36 @@ export class Slides extends Ion {
*/
update() {
setTimeout(() => {
this.swiper.update();
this.slider.update();
// Don't allow pager to show with > 10 slides
if(this.swiper.slides.length > 10) {
if(this.slider.slides.length > 10) {
this.showPager = false;
}
});
}
next() {
this.slider.slideNext();
}
prev() {
this.slider.slidePrev();
}
getIndex() {
return this.slider.activeIndex;
}
getNumSlides() {
return this.slider.slides.length;
}
isAtEnd() {
return this.slider.isEnd;
}
isAtBeginning() {
return this.slider.isBeginning;
}
getSliderWidget() {
return this.swiper;
return this.slider;
}
}