diff options
author | Kimsible <1877318+kimsible@users.noreply.github.com> | 2020-11-17 14:04:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 14:04:44 +0100 |
commit | f3081d6401b63da41b03376f9f952bf1cca8303d (patch) | |
tree | 90ec91babde1544ca0a3423b031c9e10dfcac596 /client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts | |
parent | 901c36d5f44e02436da5f5c2899666329ff2eb5b (diff) | |
download | PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.tar.gz PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.tar.zst PeerTube-f3081d6401b63da41b03376f9f952bf1cca8303d.zip |
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 <kimsible@users.noreply.github.com>
Diffstat (limited to 'client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts')
-rw-r--r-- | client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts | 7 |
1 files changed, 2 insertions, 5 deletions
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' | |||
3 | import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' | 3 | import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core' |
4 | import { NavigationEnd, Router } from '@angular/router' | 4 | import { NavigationEnd, Router } from '@angular/router' |
5 | import { MenuService, ScreenService } from '@app/core' | 5 | import { MenuService, ScreenService } from '@app/core' |
6 | import { scrollToTop } from '@app/helpers' | ||
6 | import { GlobalIconName } from '@app/shared/shared-icons' | 7 | import { GlobalIconName } from '@app/shared/shared-icons' |
7 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' | 8 | import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' |
8 | 9 | ||
@@ -96,11 +97,7 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy { | |||
96 | 97 | ||
97 | onActiveLinkScrollToTop (link: HTMLAnchorElement) { | 98 | onActiveLinkScrollToTop (link: HTMLAnchorElement) { |
98 | if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) { | 99 | if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) { |
99 | window.scrollTo({ | 100 | scrollToTop('smooth') |
100 | left: 0, | ||
101 | top: 0, | ||
102 | behavior: 'smooth' | ||
103 | }) | ||
104 | } | 101 | } |
105 | } | 102 | } |
106 | 103 | ||