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