From 0c497484b6f60f86c5723a5a60a65cd992b0d508 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sun, 3 May 2015 19:22:23 -0500 Subject: [PATCH] fix toolbars --- ionic/components/nav/nav-base.js | 2 +- ionic/components/nav/nav-item.js | 5 ----- ionic/components/nav/nav.js | 6 ++---- ionic/components/toolbar/toolbar.js | 6 +++--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/ionic/components/nav/nav-base.js b/ionic/components/nav/nav-base.js index ef69d62566..7da9a36078 100644 --- a/ionic/components/nav/nav-base.js +++ b/ionic/components/nav/nav-base.js @@ -131,7 +131,7 @@ export class NavBase { _destroy(navItem) { console.warn( -`Component "${navItem.Class.name}" was popped from the nav stack, but wer'e keeping its element in the DOM for now because of an ng2 bug.` +`Component "${navItem.Class.name}" was popped from the nav stack, but we are keeping its element in the DOM for now because of an ng2 bug.` ); // util.array.remove(this._ngNavItems, navItem) } diff --git a/ionic/components/nav/nav-item.js b/ionic/components/nav/nav-item.js index 2a23413e31..8ba731420b 100644 --- a/ionic/components/nav/nav-item.js +++ b/ionic/components/nav/nav-item.js @@ -33,11 +33,6 @@ export class NavController { } addToolbar(placement: String, toolbar: Toolbar) { - if (!this.navItem._toolbars[placement]) { - return console.error( - `Toolbar must have a placement of top or bottom, found toolbar ${toolbar} with placement ${placement}!` - ); - } this.navItem._toolbars[placement].push(toolbar); } diff --git a/ionic/components/nav/nav.js b/ionic/components/nav/nav.js index efe877d9eb..7ca2b2bce9 100644 --- a/ionic/components/nav/nav.js +++ b/ionic/components/nav/nav.js @@ -35,8 +35,7 @@ export class NavInjectable {} @NgView({ template: `
-
-
+
`, directives: [NavItem, For, If, ToolbarContainer] diff --git a/ionic/components/toolbar/toolbar.js b/ionic/components/toolbar/toolbar.js index a597d0a3d6..d10d70aa89 100644 --- a/ionic/components/toolbar/toolbar.js +++ b/ionic/components/toolbar/toolbar.js @@ -144,17 +144,17 @@ export class ToolbarTitle { }) export class ToolbarContainer { constructor( - //viewContainer: ViewContainerRef, + viewContainer: ViewContainer, element: NgElement ) { - //this.viewContainer = viewContainer; + this.viewContainer = viewContainer; this.domElement = element.domElement; } set toolbar(bar: Toolbar) { if (bar) { // TODO create with correct context - //this.viewContainer.create(-1, bar.viewContainer._defaultProtoView, bar.elementRef.elementInjector); + this.viewContainer.create(-1, bar.viewContainer.defaultProtoView, bar.elementRef.elementInjector); console.log('creating viewportContainer', performance.now()) } }