fix(gestures): gesture controller handled by components

* fix(gestures): gesture controller is handled by components

fixes #9046

* fix(gestures): adds hybrid disable scroll assistance

fixes #9130
fixes #9052
fixes #7444
This commit is contained in:
Manu Mtz.-Almeida
2016-11-16 17:03:51 +01:00
committed by Adam Bradley
parent 339857af1e
commit 32ab817181
26 changed files with 534 additions and 272 deletions

View File

@ -5,7 +5,8 @@ import { Form } from '../../util/form';
import { Key } from '../../util/key';
import { NavParams } from '../../navigation/nav-params';
import { ViewController } from '../../navigation/view-controller';
import { BlockerDelegate, GestureController, BLOCK_ALL } from '../../gestures/gesture-controller';
import { assert } from '../../util/util';
/**
* @private
@ -53,15 +54,18 @@ export class ActionSheetCmp {
hdrId: string;
id: number;
mode: string;
gestureBlocker: BlockerDelegate;
constructor(
private _viewCtrl: ViewController,
private _config: Config,
private _elementRef: ElementRef,
private _form: Form,
gestureCtrl: GestureController,
params: NavParams,
renderer: Renderer
) {
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
this.d = params.data;
this.mode = _config.get('mode');
renderer.setElementClass(_elementRef.nativeElement, `action-sheet-${this.mode}`, true);
@ -110,6 +114,14 @@ export class ActionSheetCmp {
this.d.buttons = buttons;
}
ionViewWillEnter() {
this.gestureBlocker.block();
}
ionViewDidLeave() {
this.gestureBlocker.unblock();
}
ionViewDidEnter() {
this._form.focusOut();
@ -166,6 +178,11 @@ export class ActionSheetCmp {
dismiss(role: any): Promise<any> {
return this._viewCtrl.dismiss(null, role);
}
ngOnDestroy() {
assert(this.gestureBlocker.blocked === false, 'gesture blocker must be already unblocked');
this.gestureBlocker.destroy();
}
}
let actionSheetIds = -1;