docs(demos): menu should be enabled when section loads

This commit is contained in:
Drew Rygh
2015-11-18 13:15:14 -06:00
parent cacd9a3843
commit 2f0190371d
3 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<img src="img/ios-statusbar.png" style="display:none" id="ios-only">
<ion-menu [content]="content" id="leftMenu">
<ion-menu [content]="content" id="leftMenu" side="left">
<ion-toolbar primary>
<ion-title>Menu</ion-title>

View File

@ -25,16 +25,16 @@ class DemoApp {
];
this.platform.ready().then( () => {
window.addEventListener('message', (e) => {
zone.run(() => {
if (e.data) {
var data = JSON.parse(e.data);
if (data.hash) {
this.nextPage = helpers.getPageFor(data.hash.replace('#', ''));
if (data.hash !== 'menus') {
this.app.getComponent('leftMenu').enable(false);
if (data.hash === 'menus') {
this.app.getComponent('leftMenu').enable(true);
}
} else {
this.nextPage = actionSheets.BasicPage;
@ -57,6 +57,7 @@ class DemoApp {
openPage(page) {
// close the menu when clicking a link from the menu
// debugger;
this.app.getComponent('leftMenu').close();
// Reset the content nav to have just this page

View File

@ -7,7 +7,9 @@ import * as helpers from '../../helpers';
directives: [forwardRef(() => helpers.AndroidAttribute)]
})
export class BasicPage{
constructor() {
constructor(app: IonicApp) {
this.app = app;
this.app.getComponent('leftMenu').enable(true);
}
}