mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Merge remote-tracking branch 'origin/css-refactor' into css-refactor
This commit is contained in:
@ -107,6 +107,7 @@ export class NavController extends Ion {
|
||||
config: Config,
|
||||
keyboard: Keyboard,
|
||||
elementRef: ElementRef,
|
||||
anchorName: string,
|
||||
compiler: Compiler,
|
||||
viewManager: AppViewManager,
|
||||
zone: NgZone,
|
||||
@ -119,6 +120,7 @@ export class NavController extends Ion {
|
||||
this.app = app;
|
||||
this.config = config;
|
||||
this.keyboard = keyboard;
|
||||
this._anchorName = anchorName;
|
||||
|
||||
this._compiler = compiler;
|
||||
this._viewManager = viewManager;
|
||||
@ -134,6 +136,7 @@ export class NavController extends Ion {
|
||||
this._sbEnabled = config.get('swipeBackEnabled') || false;
|
||||
this._sbThreshold = config.get('swipeBackThreshold') || 40;
|
||||
|
||||
this.initZIndex = 10;
|
||||
this.id = ++ctrlIds;
|
||||
this._ids = -1;
|
||||
|
||||
@ -484,7 +487,7 @@ export class NavController extends Ion {
|
||||
*/
|
||||
setViews(components, opts = {}) {
|
||||
console.warn('setViews() deprecated, use setPages() instead');
|
||||
this.setPages(components, opts);
|
||||
return this.setPages(components, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -906,7 +909,10 @@ export class NavController extends Ion {
|
||||
provide(NavParams, {useValue: viewCtrl.params})
|
||||
]));
|
||||
|
||||
let location = this._viewManager.getNamedElementInComponentView(this.elementRef, 'contents');
|
||||
let location = this.elementRef;
|
||||
if (this._anchorName) {
|
||||
location = this._viewManager.getNamedElementInComponentView(location, this._anchorName);
|
||||
}
|
||||
|
||||
let viewContainer = this._viewManager.getViewContainer(location);
|
||||
let hostViewRef =
|
||||
@ -973,7 +979,7 @@ export class NavController extends Ion {
|
||||
let enteringPageRef = enteringView && enteringView.pageRef();
|
||||
if (enteringPageRef) {
|
||||
if (!leavingView || !leavingView.isLoaded()) {
|
||||
enteringView.zIndex = 10;
|
||||
enteringView.zIndex = this.initZIndex;
|
||||
|
||||
} else if (direction === 'back') {
|
||||
// moving back
|
||||
|
@ -123,7 +123,7 @@ export class Nav extends NavController {
|
||||
renderer: Renderer,
|
||||
cd: ChangeDetectorRef
|
||||
) {
|
||||
super(hostNavCtrl, app, config, keyboard, elementRef, compiler, viewManager, zone, renderer, cd);
|
||||
super(hostNavCtrl, app, config, keyboard, elementRef, 'contents', compiler, viewManager, zone, renderer, cd);
|
||||
|
||||
if (viewCtrl) {
|
||||
// an ion-nav can also act as an ion-page within a parent ion-nav
|
||||
|
@ -12,7 +12,7 @@ import {NavController} from '../nav/nav-controller';
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-overlay',
|
||||
template: '<template #contents></template>'
|
||||
template: ''
|
||||
})
|
||||
export class OverlayNav extends NavController {
|
||||
|
||||
@ -28,12 +28,13 @@ export class OverlayNav extends NavController {
|
||||
renderer: Renderer,
|
||||
cd: ChangeDetectorRef
|
||||
) {
|
||||
super(null, app, config, keyboard, elementRef, compiler, viewManager, zone, renderer, cd);
|
||||
super(null, app, config, keyboard, elementRef, null, compiler, viewManager, zone, renderer, cd);
|
||||
|
||||
if (overlayCtrl.anchor) {
|
||||
throw ('An app should only have one <ion-overlay></ion-overlay>');
|
||||
}
|
||||
|
||||
this.initZIndex = 1000;
|
||||
overlayCtrl.nav = this;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ export class Tab extends NavController {
|
||||
cd: ChangeDetectorRef
|
||||
) {
|
||||
// A Tab is a NavController for its child pages
|
||||
super(parentTabs, app, config, keyboard, elementRef, compiler, viewManager, zone, renderer, cd);
|
||||
super(parentTabs, app, config, keyboard, elementRef, 'contents', compiler, viewManager, zone, renderer, cd);
|
||||
|
||||
this._isInitial = parentTabs.add(this);
|
||||
|
||||
|
Reference in New Issue
Block a user