fix(nav): zIndex in overlays

This commit is contained in:
Manu Mtz.-Almeida
2016-11-16 19:17:25 +01:00
committed by Adam Bradley
parent 7201999674
commit 70f8a8e5eb
5 changed files with 20 additions and 6 deletions

View File

@ -33,9 +33,10 @@ export class E2EPage {
}
},
{
text: 'Play',
text: 'Play (open modal)',
icon: 'arrow-dropright-circle',
handler: () => {
this.result = 'Play (open modal)';
let modal = this.modalCtrl.create(ModalPage);
modal.present();

View File

@ -19,7 +19,7 @@ export const AppRootToken = new OpaqueToken('USERROOT');
'<div #modalPortal overlay-portal></div>' +
'<div #overlayPortal overlay-portal></div>' +
'<div #loadingPortal class="loading-portal" overlay-portal></div>' +
'<div #toastPortal class="toast-portal" overlay-portal></div>' +
'<div #toastPortal class="toast-portal" [overlay-portal]="10000"></div>' +
'<div class="click-block"></div>'
})
export class IonicApp extends Ion implements OnInit {

View File

@ -1,4 +1,4 @@
import { ComponentFactoryResolver, Directive, ElementRef, forwardRef, Inject, NgZone, Optional, Renderer, ViewContainerRef } from '@angular/core';
import { ComponentFactoryResolver, Directive, ElementRef, forwardRef, Inject, Input, NgZone, Optional, Renderer, ViewContainerRef } from '@angular/core';
import { App } from '../app/app';
import { Config } from '../../config/config';
@ -12,7 +12,7 @@ import { TransitionController } from '../../transitions/transition-controller';
* @private
*/
@Directive({
selector: '[overlay-portal]'
selector: '[overlay-portal]',
})
export class OverlayPortal extends NavControllerBase {
constructor(
@ -38,4 +38,10 @@ export class OverlayPortal extends NavControllerBase {
app.viewDidLeave.subscribe(this.dismissPageChangeViews.bind(this));
}
@Input('overlay-portal')
set _overlayPortal(val: number) {
this._zIndexOffset = (val || 0);
}
}