X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=75f4bdfe62d9b8c1e10dcf09dfb0649b58013675;hb=1129f2222114e1e541df8760e24c8b68cc919237;hp=5b0439e6bb30f28e97c0608e6db5ada6ff02efd2;hpb=245b9d27bc10a4d8c8eb64add06b653f12763f56;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 5b0439e6b..75f4bdfe6 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -11,7 +11,7 @@ import { PluginService } from '@app/core/plugins/plugin.service' import { CustomModalComponent } from '@app/modal/custom-modal.component' import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component' import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' -import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { NgbConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' import { getShortLocale, is18nPath } from '@shared/core-utils/i18n' import { BroadcastMessageLevel, ServerConfig, UserRole } from '@shared/models' @@ -54,8 +54,11 @@ export class AppComponent implements OnInit, AfterViewInit { private location: PlatformLocation, private modalService: NgbModal, private markdownService: MarkdownService, + private ngbConfig: NgbConfig, public menu: MenuService - ) { } + ) { + this.ngbConfig.animation = false + } get instanceName () { return this.serverConfig.instance.name @@ -121,7 +124,7 @@ export class AppComponent implements OnInit, AfterViewInit { // scrollToAnchor first to preserve anchor position when using history navigation if (e.anchor) { setTimeout(() => { - document.getElementById(e.anchor).scrollIntoView({ behavior: 'smooth', inline: 'nearest' }) + this.viewportScroller.scrollToAnchor(e.anchor) }) return @@ -180,7 +183,7 @@ export class AppComponent implements OnInit, AfterViewInit { eventsObs.pipe( filter((e: Event): e is GuardsCheckStart => e instanceof GuardsCheckStart), - filter(() => this.screenService.isInSmallView() || !!this.screenService.isInTouchScreen()) + filter(() => this.screenService.isInSmallView() || this.screenService.isInTouchScreen()) ).subscribe(() => this.menu.setMenuDisplay(false)) // User clicked on a link in the menu, change the page }