X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fmisc%2Ftop-menu-dropdown.component.ts;h=2cafb6c55c6d68f50d17106b7e675afdeb7650b8;hb=f3081d6401b63da41b03376f9f952bf1cca8303d;hp=ba55685956b3497a0b13f38a93eace996ace8701;hpb=901c36d5f44e02436da5f5c2899666329ff2eb5b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts index ba5568595..2cafb6c55 100644 --- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts +++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts @@ -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' @@ -96,11 +97,7 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy { onActiveLinkScrollToTop (link: HTMLAnchorElement) { if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) { - window.scrollTo({ - left: 0, - top: 0, - behavior: 'smooth' - }) + scrollToTop('smooth') } }