From efc6b6b703971acd9cff7bb452a1fad40b801f87 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 17 Aug 2022 20:49:20 +0300 Subject: add "scroll to top" button to timelines and notifications --- src/components/timeline/timeline.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/timeline/timeline.js') 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), -- cgit v1.2.3-70-g09d2 From 986c4537021842e9b21c89c0ffb84033169cafe6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 24 Aug 2022 22:31:48 +0300 Subject: use a bit more compact layout on mobile --- src/components/notifications/notifications.js | 5 ++- src/components/notifications/notifications.vue | 8 +++- src/components/timeline/timeline.js | 14 ++++-- src/components/timeline/timeline.scss | 16 +++++++ src/components/timeline/timeline.vue | 61 +++++++++++++++++++------- 5 files changed, 83 insertions(+), 21 deletions(-) (limited to 'src/components/timeline/timeline.js') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 7a3d6759..058d2669 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -10,11 +10,12 @@ import { } from '../../services/notification_utils/notification_utils.js' import FaviconService from '../../services/favicon_service/favicon_service.js' import { library } from '@fortawesome/fontawesome-svg-core' -import { faCircleNotch, faCircleUp } from '@fortawesome/free-solid-svg-icons' +import { faCircleNotch, faArrowUp, faMinus } from '@fortawesome/free-solid-svg-icons' library.add( faCircleNotch, - faCircleUp + faArrowUp, + faMinus ) const DEFAULT_SEEN_TO_DISPLAY_COUNT = 30 diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index d57166eb..7577164d 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -26,7 +26,13 @@ type="button" @click="scrollToTop" > - + + + + - -
- {{ $t('timeline.up_to_date') }} -
+ + -- cgit v1.2.3-70-g09d2 From af734afe3694ff3c77d4457b93b02309c4f55d6d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 24 Aug 2022 22:46:41 +0300 Subject: lint --- src/components/notifications/notifications.vue | 16 ++++++++-------- src/components/timeline/timeline.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/components/timeline/timeline.js') diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 7577164d..08d65439 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -4,9 +4,9 @@ :to="teleportTarget" >
- - - - + + + +