Start of virtual scrolling for lists

This commit is contained in:
Max Lynch
2015-06-14 14:43:47 -05:00
parent 603a61d070
commit 8676deb325
5 changed files with 219 additions and 5 deletions

View File

@ -15,5 +15,19 @@ export class Content {
// but we should be able to stamp out this behavior with a base IonicComponent
// or something, so all elements have a domElement reference or a getElement() method
this.domElement = elementRef.domElement;
setTimeout(() => {
this.scrollElement = this.domElement.children[0];
});
}
addScrollEventListener(handler) {
if(!this.scrollElement) { return; }
this.scrollElement.addEventListener('scroll', handler);
return () => {
this.scrollElement.removeEventListener('scroll', handler);
}
}
}