* Subscribe to the mouseenter events and close any sibling menu items if this element is moused * into.
()
| 284 | * into. |
| 285 | */ |
| 286 | private _setupMouseEnter() { |
| 287 | if (!this._isStandaloneItem()) { |
| 288 | const closeOpenSiblings = () => |
| 289 | this._ngZone.run(() => this._menuStack.closeSubMenuOf(this._parentMenu!)); |
| 290 | |
| 291 | this._cleanupMouseEnter = this._ngZone.runOutsideAngular(() => |
| 292 | this._renderer.listen(this._elementRef.nativeElement, 'mouseenter', () => { |
| 293 | // Skip fake `mouseenter` events dispatched by touch devices. |
| 294 | if ( |
| 295 | this._inputModalityDetector.mostRecentModality !== 'touch' && |
| 296 | !this._menuStack.isEmpty() && |
| 297 | !this.hasMenu |
| 298 | ) { |
| 299 | if (this._menuAim) { |
| 300 | this._menuAim.toggle(closeOpenSiblings); |
| 301 | } else { |
| 302 | closeOpenSiblings(); |
| 303 | } |
| 304 | } |
| 305 | }), |
| 306 | ); |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * Return true if the enclosing parent menu is configured in a horizontal orientation, false |
no test coverage detected