mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(menu, menuClose, menuToggle): update docs
This commit is contained in:
@@ -30,6 +30,10 @@ import {Menu} from './menu';
|
||||
selector: '[menuClose]'
|
||||
})
|
||||
export class MenuClose {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() menuClose;
|
||||
|
||||
constructor(private _app: IonicApp) {}
|
||||
|
||||
@@ -32,16 +32,24 @@ import {Menu} from './menu';
|
||||
}
|
||||
})
|
||||
export class MenuToggle {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() menuToggle;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
withinNavbar: boolean;
|
||||
|
||||
constructor(
|
||||
private app: IonicApp,
|
||||
private _app: IonicApp,
|
||||
elementRef: ElementRef,
|
||||
@Optional() private viewCtrl: ViewController,
|
||||
@Optional() private navbar: Navbar
|
||||
@Optional() private _viewCtrl: ViewController,
|
||||
@Optional() private _navbar: Navbar
|
||||
) {
|
||||
this.withinNavbar = !!navbar;
|
||||
this.withinNavbar = !!_navbar;
|
||||
|
||||
// Deprecation warning
|
||||
if (this.withinNavbar && elementRef.nativeElement.tagName === 'A') {
|
||||
@@ -54,7 +62,7 @@ export class MenuToggle {
|
||||
*/
|
||||
@HostListener('click')
|
||||
toggle() {
|
||||
let menu = Menu.getById(this.app, this.menuToggle);
|
||||
let menu = Menu.getById(this._app, this.menuToggle);
|
||||
menu && menu.toggle();
|
||||
}
|
||||
|
||||
@@ -62,8 +70,8 @@ export class MenuToggle {
|
||||
* @private
|
||||
*/
|
||||
get isHidden() {
|
||||
if (this.withinNavbar && this.viewCtrl) {
|
||||
return !this.viewCtrl.isRoot();
|
||||
if (this.withinNavbar && this._viewCtrl) {
|
||||
return !this._viewCtrl.isRoot();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,19 +109,66 @@ export class Menu extends Ion {
|
||||
private _targetGesture: Gesture;
|
||||
private _type: MenuType;
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
isOpen: boolean = false;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
isEnabled: boolean = true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
isSwipeEnabled: boolean = true;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
backdrop: MenuBackdrop;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
onContentClick: EventListener;
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() content: any;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() id: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() side: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() type: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() swipeEnabled: string;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Input() maxEdgeStart;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@Output() opening: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
constructor(
|
||||
@@ -229,7 +276,7 @@ export class Menu extends Ion {
|
||||
|
||||
/**
|
||||
* Sets the state of the Menu to open or not.
|
||||
* @param {boolean} isOpen If the Menu is open or not.
|
||||
* @param {boolean} shouldOpen If the Menu is open or not.
|
||||
* @return {Promise} returns a promise once set
|
||||
*/
|
||||
setOpen(shouldOpen) {
|
||||
|
||||
Reference in New Issue
Block a user