mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
scroll docs wip
This commit is contained in:
@@ -23,14 +23,25 @@ import {IonicComponent} from '../../config/annotations';
|
||||
template: '<scroll-content><ng-content></ng-content></scroll-content>'
|
||||
})
|
||||
export class Scroll extends Ion {
|
||||
constructor(elementRef: ElementRef, ionicConfig: IonicConfig) {
|
||||
super(elementRef, ionicConfig);
|
||||
/**
|
||||
* TODO
|
||||
* @param {ElementRef} elementRef TODO
|
||||
* @param {IonicConfig} config TODO
|
||||
*/
|
||||
constructor(elementRef: ElementRef, config: IonicConfig) {
|
||||
super(elementRef, config);
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollElement = this.getNativeElement().children[0];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a scroll event handler to the scroll element if it exists.
|
||||
* @param {Function} handler The scroll handler to add to the scroll element.
|
||||
* @returns {?Function} a function to remove the specified handler, otherwise
|
||||
* undefined if the scroll element doesn't exist.
|
||||
*/
|
||||
addScrollEventListener(handler) {
|
||||
if(!this.scrollElement) { return; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user