Collapses the current menu or focuses the previous item in the menubar.
()
| 429 | |
| 430 | /** Collapses the current menu or focuses the previous item in the menubar. */ |
| 431 | collapse() { |
| 432 | const root = this.root(); |
| 433 | const parent = this.inputs.parent(); |
| 434 | |
| 435 | if (parent instanceof MenuItemPattern && !(parent.inputs.parent() instanceof MenuBarPattern)) { |
| 436 | parent.close({refocus: true}); |
| 437 | } else if (root instanceof MenuBarPattern) { |
| 438 | root.prev(); |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | /** Expands the current menu or focuses the next item in the menubar. */ |
| 443 | expand() { |
no test coverage detected