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

@ -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);
}
}