* Pop off all MenuStackItems and emit each one on the `close` observable one by one. * @param options Options that configure behavior on close.
(options?: CloseOptions)
| 162 | * @param options Options that configure behavior on close. |
| 163 | */ |
| 164 | closeAll(options?: CloseOptions) { |
| 165 | const {focusNextOnEmpty, focusParentTrigger} = {...options}; |
| 166 | if (!this.isEmpty()) { |
| 167 | while (!this.isEmpty()) { |
| 168 | const menuStackItem = this._elements.pop(); |
| 169 | if (menuStackItem) { |
| 170 | this._close.next({item: menuStackItem, focusParentTrigger}); |
| 171 | } |
| 172 | } |
| 173 | this._empty.next(focusNextOnEmpty); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** Return true if this stack is empty. */ |
| 178 | isEmpty() { |
no test coverage detected