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">
|
<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>
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user