From d7b33fbfe6b40e4d519d766bb47bf59d33290d01 Mon Sep 17 00:00:00 2001 From: Frido Emans Date: Fri, 23 Sep 2022 16:21:22 +0200 Subject: [PATCH] revert --- src/composables/footer.ts | 12 ++++------ src/composables/useFileListComposable.js | 30 ++++++------------------ 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/src/composables/footer.ts b/src/composables/footer.ts index 9c24cd8b..770097d3 100644 --- a/src/composables/footer.ts +++ b/src/composables/footer.ts @@ -4,14 +4,6 @@ import { useRoute } from "vue-router"; import { playlistVisible, audioPlayer, audioDetailPopup } from "@/composables/audioControls"; export const _footerVisible = ref(true); -const coveringPanel = computed( - () => audioPlayer.value.file || playlistVisible.value || audioDetailPopup.value -); - -const hideFooter = () => { - _footerVisible.value = false; -}; - export const useFooter = () => { const route = useRoute(); @@ -21,6 +13,10 @@ export const useFooter = () => { return _footerVisible.value && route.name === "Search"; }); + const hideFooter = () => { + _footerVisible.value = false; + }; + const adjustFooterPadding = computed(() => { if (audioPlayer.value.file) return "100px"; if (footerVisible.value) return "120px"; diff --git a/src/composables/useFileListComposable.js b/src/composables/useFileListComposable.js index b86d6e28..df9fe007 100644 --- a/src/composables/useFileListComposable.js +++ b/src/composables/useFileListComposable.js @@ -8,9 +8,6 @@ import durationToColor from "@/helpers/durationToColor"; import mime from "mime"; import { Types } from "@/helpers/typeHelper"; import getResourceURL from "@/helpers/resourceURL"; -import { enterSearchQuery } from "@/router"; - -const infiniteScrollMargin = 200; export const useFileListComposable = ({ fileType }) => { const route = useRoute(); @@ -48,25 +45,6 @@ export const useFileListComposable = ({ fileType }) => { return pageHits.value; } - /** - * See if the the page scrolled so far down that empty space opens up at the bottom. - * Also update the url - * used by ImageList - */ - const infiniteScroll = () => { - const { scrollTop, scrollHeight } = document.getElementById("search-view"); - // calculate, which page is currently in view - const scrollPage = Math.floor(loadedPages.value * (scrollTop / scrollHeight)) + 1; - // if needed, change the page in the URL - if (store.state.query.page !== scrollPage) { - enterSearchQuery(route.query, scrollPage, "replace"); - } - const nearBottom = window.innerHeight + infiniteScrollMargin > scrollHeight - scrollTop; - if (nearBottom && !loading.value) { - return store.dispatch(`results/${fileType}/fetchPage`, { page: loadedPages.value + 1 }); - } - }; - return { pageHits, loading, @@ -74,6 +52,12 @@ export const useFileListComposable = ({ fileType }) => { infinite, loadedPages, slicedHits, - infiniteScroll, }; }; + +export const imports = { + mime, + durationToColor, + prettyBytes, + getResourceURL, +};