From f3081d6401b63da41b03376f9f952bf1cca8303d Mon Sep 17 00:00:00 2001 From: Kimsible <1877318+kimsible@users.noreply.github.com> Date: Tue, 17 Nov 2020 14:04:44 +0100 Subject: small refactor + clipboard copy on anchor click in instance page (#3318) * Refacto scrollTo top and anchors * Add on click clipboard copy and notifier to anchors about/instance page * Fix margin top anchor middle title about page * Use viewportscroller for scrolltoanchor * Add to Link copied notification on instance page Co-authored-by: kimsible --- .../src/app/shared/shared-main/misc/top-menu-dropdown.component.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-main/misc') 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') } } -- cgit v1.2.3