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"> <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-toolbar primary>
<ion-title>Menu</ion-title> <ion-title>Menu</ion-title>

View File

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

View File

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