aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/menu/top-menu-dropdown.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-12-18 09:31:09 +0100
committerChocobozzz <me@florianbigard.com>2018-12-18 11:35:51 +0100
commit80bfd33c0bf910e2cfdd3270b14ba9eddd90e2e8 (patch)
tree80cd14e2f503db64ebec5fcfbb94ce5db25f46c9 /client/src/app/shared/menu/top-menu-dropdown.component.ts
parent8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4 (diff)
downloadPeerTube-80bfd33c0bf910e2cfdd3270b14ba9eddd90e2e8.tar.gz
PeerTube-80bfd33c0bf910e2cfdd3270b14ba9eddd90e2e8.tar.zst
PeerTube-80bfd33c0bf910e2cfdd3270b14ba9eddd90e2e8.zip
Add history page on client
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.ts14
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 @@
1import { Component, Input, OnDestroy, OnInit } from '@angular/core' 1import { Component, Input, OnDestroy, OnInit } from '@angular/core'
2import { filter, take } from 'rxjs/operators' 2import { filter, take } from 'rxjs/operators'
3import { NavigationStart, Router } from '@angular/router' 3import { NavigationEnd, Router } from '@angular/router'
4import { Subscription } from 'rxjs' 4import { Subscription } from 'rxjs'
5import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' 5import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
6import { drop } from 'lodash-es'
7 6
8export type TopMenuDropdownParam = { 7export 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