]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/helpers/utils.ts
small refactor + clipboard copy on anchor click in instance page (#3318)
[github/Chocobozzz/PeerTube.git] / client / src / app / helpers / utils.ts
index d9007dd77490d53079cba4587f43bd613f8c5bbe..a22507f46a3e914c4711cf99d79681607e18561b 100644 (file)
@@ -144,8 +144,12 @@ function sortBy (obj: any[], key1: string, key2?: string) {
   })
 }
 
-function scrollToTop () {
-  window.scroll(0, 0)
+function scrollToTop (behavior: 'auto' | 'smooth' = 'auto') {
+  window.scrollTo({
+    left: 0,
+    top: 0,
+    behavior
+  })
 }
 
 function isInViewport (el: HTMLElement) {