mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
docs(demos): menu should be enabled when section loads
This commit is contained in:
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user