mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -197,7 +197,26 @@ export class MenuController {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to get a menu instance.
|
||||
* @return {boolean} Returns true if the menu is currently open, otherwise false.
|
||||
*/
|
||||
isOpen(menuId?: string): boolean {
|
||||
let menu = this.get(menuId);
|
||||
return menu && menu.isOpen || false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean} Returns true if the menu is currently enabled, otherwise false.
|
||||
*/
|
||||
isEnabled(menuId?: string): boolean {
|
||||
let menu = this.get(menuId);
|
||||
return menu && menu.isEnabled || false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to get a menu instance. If a `menuId` is not provided then it'll return
|
||||
* the first menu found. If a `menuId` is provided, then it'll first try to find
|
||||
* the menu using the menu's `id` attribute. If a menu is not found using the `id`
|
||||
* attribute, then it'll try to find the menu by its `side` name.
|
||||
* @param {string} [menuId] Optionally get the menu by its id, or side.
|
||||
* @return {Menu} Returns the instance of the menu if found, otherwise `null`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user