This commit is contained in:
Max Lynch
2015-07-03 13:22:07 -05:00
parent 1ae3113386
commit 6ab57f916d
2 changed files with 57 additions and 9 deletions

View File

@ -1,8 +1,28 @@
ion-refresher {
position: fixed;
display: block;
height: 100px;
position: absolute;
top: -60px;
right: 0;
left: 0;
overflow: hidden;
margin: auto;
height: 60px;
.refresher {
position: absolute;
bottom: 15px;
left: 0;
width: 100%;
background-color: red;
z-index: 0;
color: #fff;
text-align: center;
font-size: 30px;
.text-refreshing,
.text-pulling {
font-size: 16px;
line-height: 16px;
}
&.ionic-refresher-with-text {
bottom: 10px;
}
}
}

View File

@ -18,12 +18,12 @@ export class Refresher {
this.ele = element.nativeElement;
this.ele.classList.add('content');
this.content = content;
this.refresh = new EventEmitter('refresh');
setTimeout(() => {
content.scrollElement.addEventListener('scroll', function(e) {
console.log('CONTENT: scroll', e.target.scrollTop);
});
this.initEvents();
}, 1000);
}
@ -33,4 +33,32 @@ export class Refresher {
amt: 0
});
}
initEvents() {
let sp = this.content;
let sc = this.content.scrollElement;
sc.addEventListener('touchmove', this._handleTouchMove);
sc.addEventListener('touchend', this._handleTouchEnd);
sc.addEventListener('scroll', this._handleScroll);
}
onDehydrate() {
console.log('DEHYDRATION');
let sc = this.content.scrollElement;
sc.removeEventListener('touchmove', this._handleTouchMove);
sc.removeEventListener('touchend', this._handleTouchEnd);
sc.removeEventListener('scroll', this._handleScroll);
}
_handleTouchMove(e) {
console.log('TOUCHMOVE', e);
}
_handleTouchEnd(e) {
console.log('TOUCHEND', e);
}
_handleScroll(e) {
console.log('SCROLL', e.target.scrollTop);
}
}