mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
fix toolbars
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,7 @@ export class NavInjectable {}
|
||||
@NgView({
|
||||
template: `
|
||||
<header class="toolbar-container" [class.hide]="getToolbars('top').length == 0">
|
||||
<div *for="#toolbar of getToolbars('top')" [toolbar-create]="toolbar">
|
||||
</div>
|
||||
<div *for="#toolbar of getToolbars('top')" [toolbar-create]="toolbar"></div>
|
||||
</header>
|
||||
<section class="nav-item-container">
|
||||
<div class="nav-item"
|
||||
@ -44,8 +43,7 @@ export class NavInjectable {}
|
||||
[item]="item"></div>
|
||||
</section>
|
||||
<footer class="toolbar-container" [class.hide]="getToolbars('bottom').length == 0">
|
||||
<div *for="#toolbar of getToolbars('bottom')" [toolbar-create]="toolbar">
|
||||
</div>
|
||||
<div *for="#toolbar of getToolbars('bottom')" [toolbar-create]="toolbar"></div>
|
||||
</footer>
|
||||
`,
|
||||
directives: [NavItem, For, If, ToolbarContainer]
|
||||
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user