updated toolbar show/hide

This commit is contained in:
Adam Bradley
2015-05-06 11:31:01 -05:00
parent e36d48fdfc
commit f783be2e13
5 changed files with 18 additions and 11 deletions

View File

@ -6,9 +6,9 @@ import {
@Component({
selector: 'ion-content',
hostProperties: {
contentClass: 'class.content'
}
// hostProperties: {
// contentClass: 'class.content'
// }
})
@View({
template: `
@ -18,7 +18,7 @@ import {
})
export class Content {
constructor() {
this.contentClass = true;
//this.contentClass = true;
console.log('Content!');
}
}

View File

@ -258,6 +258,14 @@ export class NavBase {
return last && last.navItem && last.navItem._toolbars[pos] || [];
}
get hideHeader() {
return !this.getToolbars('top').length;
}
get hideFooter() {
return !this.getToolbars('bottom').length;
}
canSwipeBack() {
return !!this.getPrevious(this.getActive());
}
@ -269,6 +277,7 @@ class NavStackItem {
constructor(ComponentClass, params = {}) {
this.Class = ComponentClass;
this.params = params;
this.id = util.nextUid();
this._setupPromise = new Promise((resolve) => {
this._resolveSetup = resolve;
});

View File

@ -34,15 +34,13 @@ export class NavInjectable {}
})
@View({
template: `
<header class="toolbar-container" [class.hide]="getToolbars('top').length == 0">
<header class="toolbar-container" [class.hide]="hideHeader">
<div *for="#toolbar of getToolbars('top')" [toolbar-create]="toolbar"></div>
</header>
<section class="nav-item-container">
<div class="nav-item"
*for="#item of navItems"
[item]="item"></div>
<div class="nav-item" *for="#item of navItems" [item]="item"></div>
</section>
<footer class="toolbar-container" [class.hide]="getToolbars('bottom').length == 0">
<footer class="toolbar-container" [class.hide]="hideFooter">
<div *for="#toolbar of getToolbars('bottom')" [toolbar-create]="toolbar"></div>
</footer>
`,

View File

@ -6,7 +6,7 @@ import {SecondPage} from 'pages/second-page'
@Component()
@View({
templateUrl: 'pages/first-page.html',
directives: [Toolbar, Content]
directives: [Toolbar]
})
export class FirstPage {
constructor(

View File

@ -6,7 +6,7 @@ import {ThirdPage} from 'pages/third-page'
@Component()
@View({
templateUrl: 'pages/second-page.html',
directives: [Toolbar, Content]
directives: [Toolbar]
})
export class SecondPage {
constructor(