diff --git a/src/components/JournalView/JournalDispatchers.vue b/src/components/JournalView/JournalDispatchers.vue index 96464e8..f6d8a8b 100644 --- a/src/components/JournalView/JournalDispatchers.vue +++ b/src/components/JournalView/JournalDispatchers.vue @@ -8,7 +8,7 @@ :sorter-option-ids="['timestampFrom', 'duration']" /> -
+
@@ -34,10 +34,10 @@
-
-
{{ $t('journal.no-further-data') }}
-
{{ $t('journal.loading-further-data') }}
+
{{ $t('journal.no-further-data') }}
+
{{ $t('journal.loading-further-data') }}
+ @@ -137,8 +137,6 @@ export default defineComponent({ this.searchersValues['search-dispatcher'] = this.dispatcherName?.toString() || ''; this.search(); } - - window.addEventListener('scroll', this.handleScroll); }, mounted() { @@ -147,27 +145,15 @@ export default defineComponent({ } }, - deactivated() { - window.removeEventListener('scroll', this.handleScroll); - }, - methods: { - closeDispatcherStatsCard() { - this.statsCardOpen = false; - }, + handleScroll(e: Event) { + const listElement = e.target as HTMLElement; + const scrollTop = listElement.scrollTop; + const elementHeight = listElement.scrollHeight - listElement.offsetHeight; - handleScroll() { - this.showReturnButton = window.scrollY > window.innerHeight; + if (!this.scrollDataLoaded || this.scrollNoMoreData || this.dataStatus != DataStatus.Loaded) return; - const element = this.$refs.scrollElement as HTMLElement; - - if ( - element.getBoundingClientRect().bottom * 0.85 < window.innerHeight && - this.scrollDataLoaded && - !this.scrollNoMoreData && - this.dataStatus == DataStatus.Loaded - ) - this.addHistoryData(); + if (scrollTop > elementHeight * 0.85) this.addHistoryData(); }, search() { diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 56b4f1a..e31e565 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -1,16 +1,30 @@