aboutsummaryrefslogtreecommitdiff
path: root/src/components/timeline/timeline.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-08-17 20:49:20 +0300
committerHenry Jameson <me@hjkos.com>2022-08-17 20:49:20 +0300
commitefc6b6b703971acd9cff7bb452a1fad40b801f87 (patch)
tree43b8262d6335e00db9d0850f6b51e088db21c263 /src/components/timeline/timeline.js
parent2c76c46aa7aa72cf1894f11e7da3fc6e60caabfa (diff)
add "scroll to top" button to timelines and notifications
Diffstat (limited to 'src/components/timeline/timeline.js')
-rw-r--r--src/components/timeline/timeline.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 8f6cae66..6fca869f 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -29,6 +29,7 @@ const Timeline = {
],
data () {
return {
+ showScrollTop: false,
paused: false,
unfocused: false,
bottomedOut: false,
@@ -123,6 +124,9 @@ const Timeline = {
this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
},
methods: {
+ scrollToTop () {
+ window.scrollTo({ top: this.$el.offsetTop })
+ },
stopBlockingClicks: debounce(function () {
this.blockingClicks = false
}, 1000),
@@ -222,6 +226,7 @@ const Timeline = {
}
},
handleScroll: throttle(function (e) {
+ this.showScrollTop = this.$el.offsetTop < window.scrollY
this.determineVisibleStatuses()
this.scrollLoad(e)
}, 200),