X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=5b0439e6bb30f28e97c0608e6db5ada6ff02efd2;hb=f2c6ebc61b55df6e5dfbeed6413f3c908ea7846a;hp=ef0b1ae56efff122389b63638169bd570b238491;hpb=66357162f8e1227495f09bd4f68446aad7071c6d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index ef0b1ae56..5b0439e6b 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -121,7 +121,7 @@ export class AppComponent implements OnInit, AfterViewInit { // scrollToAnchor first to preserve anchor position when using history navigation if (e.anchor) { setTimeout(() => { - this.viewportScroller.scrollToAnchor(e.anchor) + document.getElementById(e.anchor).scrollIntoView({ behavior: 'smooth', inline: 'nearest' }) }) return @@ -180,8 +180,8 @@ export class AppComponent implements OnInit, AfterViewInit { eventsObs.pipe( filter((e: Event): e is GuardsCheckStart => e instanceof GuardsCheckStart), - filter(() => this.screenService.isInSmallView()) - ).subscribe(() => this.menu.isMenuDisplayed = false) // User clicked on a link in the menu, change the page + filter(() => this.screenService.isInSmallView() || !!this.screenService.isInTouchScreen()) + ).subscribe(() => this.menu.setMenuDisplay(false)) // User clicked on a link in the menu, change the page } private injectBroadcastMessage () {