Merge remote-tracking branch 'origin/css-refactor' into css-refactor

This commit is contained in:
Brandy Carney
2015-12-08 14:32:52 -05:00
4 changed files with 14 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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);