mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(gesture-controller): disable/enable scrolling
This commit is contained in:
@@ -31,6 +31,11 @@ export class App {
|
||||
*/
|
||||
clickBlock: ClickBlock;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
appRoot: AppRoot;
|
||||
|
||||
viewDidLoad: EventEmitter<any> = new EventEmitter();
|
||||
viewWillEnter: EventEmitter<any> = new EventEmitter();
|
||||
viewDidEnter: EventEmitter<any> = new EventEmitter();
|
||||
@@ -86,6 +91,17 @@ export class App {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setScrollDisabled(disabled: boolean) {
|
||||
if (!this.appRoot) {
|
||||
console.error('appRoot is missing, scrolling can not be enabled/disabled');
|
||||
return;
|
||||
}
|
||||
this.appRoot.disableScroll = disabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
* Boolean if the app is actively enabled or not.
|
||||
@@ -282,9 +298,13 @@ export class AppRoot {
|
||||
@ViewChild('anchor', {read: ViewContainerRef}) private _viewport: ViewContainerRef;
|
||||
|
||||
constructor(
|
||||
private _cmp: UserComponent,
|
||||
private _cr: ComponentResolver,
|
||||
private _renderer: Renderer) {}
|
||||
private _cmp: UserComponent,
|
||||
private _cr: ComponentResolver,
|
||||
private _renderer: Renderer,
|
||||
app: App
|
||||
) {
|
||||
app.appRoot = this;
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
// load the user app's root component
|
||||
|
||||
Reference in New Issue
Block a user