mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
updated toolbar show/hide
This commit is contained in:
@ -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!');
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
});
|
||||
|
@ -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>
|
||||
`,
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
Reference in New Issue
Block a user