diff options
Diffstat (limited to 'src/components/timeline')
| -rw-r--r-- | src/components/timeline/timeline.js | 5 | ||||
| -rw-r--r-- | src/components/timeline/timeline.vue | 8 |
2 files changed, 13 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), diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 627cafbb..a6bfeed1 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -3,6 +3,14 @@ <div :class="classes.header"> <TimelineMenu v-if="!embedded" /> <button + v-if="showScrollTop" + class="button-unstyled scroll-to-top-button" + type="button" + @click="scrollToTop" + > + <FAIcon icon="circle-up" /> + </button> + <button v-if="showLoadButton" class="button-default loadmore-button" @click.prevent="showNewStatuses" |
