]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / misc / top-menu-dropdown.component.ts
index 043b647c9b3813f904cf9d97dbeae56623f4dfa6..2cafb6c55c6d68f50d17106b7e675afdeb7650b8 100644 (file)
@@ -3,6 +3,7 @@ import { filter } from 'rxjs/operators'
 import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
 import { NavigationEnd, Router } from '@angular/router'
 import { MenuService, ScreenService } from '@app/core'
+import { scrollToTop } from '@app/helpers'
 import { GlobalIconName } from '@app/shared/shared-icons'
 import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
 
@@ -94,6 +95,12 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
     this.isModalOpened = false
   }
 
+  onActiveLinkScrollToTop (link: HTMLAnchorElement) {
+    if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) {
+      scrollToTop('smooth')
+    }
+  }
+
   dismissOtherModals () {
     this.modalService.dismissAll()
   }