| 324 | |
| 325 | @HostListener('window:resize', ['$event.target.innerWidth']) |
| 326 | onResize(width: number) { |
| 327 | this.isSideBySide = width >= this.sideBySideWidth; |
| 328 | this.showFloatingToc.next(width > this.showFloatingTocWidth); |
| 329 | |
| 330 | if (this.isSideBySide && !this.isSideNavDoc) { |
| 331 | // If this is a non-sidenav doc and the screen is wide enough so that we can display menu |
| 332 | // items in the top-bar, ensure the sidenav is closed. |
| 333 | // (This condition can only be met when the resize event changes the value of `isSideBySide` |
| 334 | // from `false` to `true` while on a non-sidenav doc.) |
| 335 | this.sidenav.toggle(false); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | @HostListener('click', ['$event.target', '$event.button', '$event.ctrlKey', '$event.metaKey', '$event.altKey']) |
| 340 | onClick(eventTarget: HTMLElement, button: number, ctrlKey: boolean, metaKey: boolean, altKey: boolean): boolean { |