aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/helpers
diff options
context:
space:
mode:
authorKimsible <1877318+kimsible@users.noreply.github.com>2020-11-17 14:04:44 +0100
committerGitHub <noreply@github.com>2020-11-17 14:04:44 +0100
commitf3081d6401b63da41b03376f9f952bf1cca8303d (patch)
tree90ec91babde1544ca0a3423b031c9e10dfcac596 /client/src/app/helpers
parent901c36d5f44e02436da5f5c2899666329ff2eb5b (diff)
downloadPeerTube-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/helpers')
-rw-r--r--client/src/app/helpers/utils.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index d9007dd77..a22507f46 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -144,8 +144,12 @@ function sortBy (obj: any[], key1: string, key2?: string) {
144 }) 144 })
145} 145}
146 146
147function scrollToTop () { 147function scrollToTop (behavior: 'auto' | 'smooth' = 'auto') {
148 window.scroll(0, 0) 148 window.scrollTo({
149 left: 0,
150 top: 0,
151 behavior
152 })
149} 153}
150 154
151function isInViewport (el: HTMLElement) { 155function isInViewport (el: HTMLElement) {