MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / _setOpen

Method _setOpen

core/src/components/menu/menu.tsx:468–492  ·  view source on GitHub ↗
(shouldOpen: boolean, animated = true, role?: string)

Source from the content-addressed store, hash-verified

466 }
467
468 async _setOpen(shouldOpen: boolean, animated = true, role?: string): Promise<boolean> {
469 // If the menu is disabled or it is currently being animated, let's do nothing
470 if (!this._isActive() || this.isAnimating || shouldOpen === this._isOpen) {
471 return false;
472 }
473
474 this.beforeAnimation(shouldOpen, role);
475
476 await this.loadAnimation();
477 await this.startAnimation(shouldOpen, animated);
478
479 /**
480 * If the animation was cancelled then
481 * return false because the operation
482 * did not succeed.
483 */
484 if (this.operationCancelled) {
485 this.operationCancelled = false;
486 return false;
487 }
488
489 this.afterAnimation(shouldOpen, role);
490
491 return true;
492 }
493
494 private async loadAnimation(): Promise<void> {
495 // Menu swipe animation takes the menu's inner width as parameter,

Callers

nothing calls this directly

Calls 5

_isActiveMethod · 0.95
beforeAnimationMethod · 0.95
loadAnimationMethod · 0.95
startAnimationMethod · 0.95
afterAnimationMethod · 0.95

Tested by

no test coverage detected