* refactor(overlays): overlays now are enabled via ionViewDidEnter (#6811) closes #6753

overalys now are enabled via ionViewDidEnter

* style(overlays): fixed tslint error

fixed tslint error

* style(overlays): formatting

formatting

* refactor(overlays): minor refactor to match style

minor refactor to match style
This commit is contained in:
Dan Bucholtz
2016-06-09 13:35:03 -05:00
committed by GitHub
parent 7a3477b782
commit 2be96f29b2
8 changed files with 42 additions and 65 deletions

View File

@ -170,8 +170,8 @@ class PopoverCmp {
@ViewChild('viewport', {read: ViewContainerRef}) viewport: ViewContainerRef;
private d: any;
private enabled: boolean;
private id: number;
private created: number;
private showSpinner: boolean;
constructor(
@ -183,7 +183,6 @@ class PopoverCmp {
private _viewCtrl: ViewController
) {
this.d = _navParams.data.opts;
this.created = Date.now();
if (this.d.cssClass) {
_renderer.setElementClass(_elementRef.nativeElement, this.d.cssClass, true);
@ -210,6 +209,7 @@ class PopoverCmp {
if (document.activeElement) {
activeElement.blur();
}
this.enabled = true;
}
dismiss(role: any): Promise<any> {
@ -222,15 +222,10 @@ class PopoverCmp {
}
bdClick() {
if (this.isEnabled() && this.d.enableBackdropDismiss) {
if (this.enabled && this.d.enableBackdropDismiss) {
this.dismiss('backdrop');
}
}
isEnabled() {
let tm = this._config.getNumber('overlayCreatedDiff', 750);
return (this.created + tm < Date.now());
}
}
export interface PopoverOptions {