(shouldOpen: boolean, animated = true, role?: string)
| 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, |
nothing calls this directly
no test coverage detected