diff options
Diffstat (limited to 'client/src/app/shared/menu/top-menu-dropdown.component.ts')
-rw-r--r-- | client/src/app/shared/menu/top-menu-dropdown.component.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.ts b/client/src/app/shared/menu/top-menu-dropdown.component.ts index 272b721b2..e859c30dd 100644 --- a/client/src/app/shared/menu/top-menu-dropdown.component.ts +++ b/client/src/app/shared/menu/top-menu-dropdown.component.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, Input, OnDestroy, OnInit } from '@angular/core' |
2 | import { filter, take } from 'rxjs/operators' | 2 | import { filter, take } from 'rxjs/operators' |
3 | import { NavigationStart, Router } from '@angular/router' | 3 | import { NavigationEnd, Router } from '@angular/router' |
4 | import { Subscription } from 'rxjs' | 4 | import { Subscription } from 'rxjs' |
5 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | 5 | import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' |
6 | import { drop } from 'lodash-es' | ||
7 | 6 | ||
8 | export type TopMenuDropdownParam = { | 7 | export type TopMenuDropdownParam = { |
9 | label: string | 8 | label: string |
@@ -34,7 +33,7 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy { | |||
34 | this.updateChildLabels(window.location.pathname) | 33 | this.updateChildLabels(window.location.pathname) |
35 | 34 | ||
36 | this.routeSub = this.router.events | 35 | this.routeSub = this.router.events |
37 | .pipe(filter(event => event instanceof NavigationStart)) | 36 | .pipe(filter(event => event instanceof NavigationEnd)) |
38 | .subscribe(() => this.updateChildLabels(window.location.pathname)) | 37 | .subscribe(() => this.updateChildLabels(window.location.pathname)) |
39 | } | 38 | } |
40 | 39 | ||
@@ -52,6 +51,15 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy { | |||
52 | .subscribe(e => this.openedOnHover = false) | 51 | .subscribe(e => this.openedOnHover = false) |
53 | } | 52 | } |
54 | 53 | ||
54 | dropdownAnchorClicked (dropdown: NgbDropdown) { | ||
55 | if (this.openedOnHover) { | ||
56 | this.openedOnHover = false | ||
57 | return | ||
58 | } | ||
59 | |||
60 | return dropdown.toggle() | ||
61 | } | ||
62 | |||
55 | closeDropdownIfHovered (dropdown: NgbDropdown) { | 63 | closeDropdownIfHovered (dropdown: NgbDropdown) { |
56 | if (this.openedOnHover === false) return | 64 | if (this.openedOnHover === false) return |
57 | 65 | ||