From 71863061c691df7f59cf4be283a3e0772d485378 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 4 Apr 2022 19:41:09 +0300 Subject: fixed tons of stuff, at least it looks normalish on desktop --- src/components/timeline/timeline.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/timeline/timeline.js') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 8ec5d1e5..9056319b 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -64,7 +64,7 @@ const Timeline = { if (this.blockingClicks) rootClasses = rootClasses.concat(['-blocked', '_misclick-prevention']) return { root: rootClasses, - header: ['timeline-heading'].concat(!this.embedded ? ['panel-heading'] : []), + header: ['timeline-heading'].concat(!this.embedded ? ['panel-heading', '-sticky'] : []), body: ['timeline-body'].concat(!this.embedded ? ['panel-body'] : []), footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : []) } @@ -89,7 +89,7 @@ const Timeline = { const credentials = store.state.users.currentUser.credentials const showImmediately = this.timeline.visibleStatuses.length === 0 - window.addEventListener('scroll', this.handleScroll) + document.getElementById('content').addEventListener('scroll', this.handleScroll) if (store.state.api.fetchers[this.timelineName]) { return false } @@ -111,7 +111,7 @@ const Timeline = { setTimeout(this.determineVisibleStatuses, 250) }, unmounted () { - window.removeEventListener('scroll', this.handleScroll) + document.getElementById('content').removeEventListener('scroll', this.handleScroll) window.removeEventListener('keydown', this.handleShortKey) if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false) this.$store.commit('setLoading', { timeline: this.timelineName, value: false }) -- cgit v1.2.3-70-g09d2 From 8d623ab1ea098b107c8aa22f01a410066f6b0d60 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 7 Apr 2022 11:36:14 +0300 Subject: fix some scroll issues --- src/components/timeline/timeline.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/components/timeline/timeline.js') diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 9056319b..4b2c1e81 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -12,6 +12,8 @@ library.add( faCog ) +const scroller = () => document.getElementById('content') + const Timeline = { props: [ 'timeline', @@ -89,7 +91,7 @@ const Timeline = { const credentials = store.state.users.currentUser.credentials const showImmediately = this.timeline.visibleStatuses.length === 0 - document.getElementById('content').addEventListener('scroll', this.handleScroll) + scroller().addEventListener('scroll', this.handleScroll) if (store.state.api.fetchers[this.timelineName]) { return false } @@ -111,7 +113,7 @@ const Timeline = { setTimeout(this.determineVisibleStatuses, 250) }, unmounted () { - document.getElementById('content').removeEventListener('scroll', this.handleScroll) + scroller().removeEventListener('scroll', this.handleScroll) window.removeEventListener('keydown', this.handleShortKey) if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false) this.$store.commit('setLoading', { timeline: this.timelineName, value: false }) @@ -141,6 +143,7 @@ const Timeline = { this.$store.commit('showNewStatuses', { timeline: this.timelineName }) this.paused = false } + scroller().scrollTop = 0 }, fetchOlderStatuses: throttle(function () { const store = this.$store @@ -228,8 +231,8 @@ const Timeline = { } if (count > 0) { // only 'stream' them when you're scrolled to the top - const doc = document.documentElement - const top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0) + const doc = document.getElementById('content') + const top = (doc.scrollTop) - (doc.clientTop || 0) if (top < 15 && !this.paused && !(this.unfocused && this.$store.getters.mergedConfig.pauseOnUnfocused) -- cgit v1.2.3-70-g09d2 From b5ded67c0608724fe23be15e346dd6842819635f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 7 Apr 2022 15:11:23 +0300 Subject: options to enable scrollbars and disable sticky headers --- src/App.js | 2 ++ src/App.scss | 27 ++++++++++++++++++---- src/App.vue | 6 ++--- src/components/settings_modal/tabs/general_tab.vue | 10 ++++++++ src/components/timeline/timeline.js | 2 +- src/modules/config.js | 2 ++ src/panel.scss | 3 +-- 7 files changed, 42 insertions(+), 10 deletions(-) (limited to 'src/components/timeline/timeline.js') diff --git a/src/App.js b/src/App.js index 26a188f4..75fa3a3c 100644 --- a/src/App.js +++ b/src/App.js @@ -82,6 +82,8 @@ export default { layoutType () { return this.$store.state.interface.layoutType }, privateMode () { return this.$store.state.instance.private }, reverseLayout () { return this.$store.getters.mergedConfig.sidebarRight }, + noSticky () { return this.$store.getters.mergedConfig.disableStickyHeaders }, + showScrollbars () { return this.$store.getters.mergedConfig.showScrollbars }, ...mapGetters(['mergedConfig']) }, methods: { diff --git a/src/App.scss b/src/App.scss index 1867a54d..ac6cf3f4 100644 --- a/src/App.scss +++ b/src/App.scss @@ -59,6 +59,7 @@ nav { #content { overscroll-behavior-y: none; overflow-y: auto; + overflow-x: hidden; position: sticky; } @@ -136,6 +137,19 @@ nav { max-height: calc(100vh - var(--navbar-height)); overflow-y: auto; overflow-x: hidden; + margin-left: -2em; + padding-left: 2.5em; + + &:not(.-show-scrollbar) { + scrollbar-width: none; + margin-right: -2em; + padding-right: 2.5em; + + &::-webkit-scrollbar { + display: block; + width: 0; + } + } .panel-heading.-sticky { top: -10px; @@ -143,6 +157,15 @@ nav { } } + &.-no-sticky-headers { + .column { + .panel-heading.-sticky { + position: relative; + top: 0; + } + } + } + .column-inner { display: grid; grid-template-columns: 100%; @@ -186,10 +209,6 @@ nav { #content, .column.-scrollable { - &::-webkit-scrollbar { - display: block; - width: 0; - } } .text-center { diff --git a/src/App.vue b/src/App.vue index 70084538..243a3314 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,10 +13,10 @@
-