From d667d97f62b760c809a1046cf961be651bbbedec Mon Sep 17 00:00:00 2001 From: banbxio Date: Thu, 27 Mar 2025 01:42:54 +0800 Subject: [PATCH] style: FileListing.vue --- frontend/src/views/files/FileListing.vue | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/files/FileListing.vue b/frontend/src/views/files/FileListing.vue index 7e5db252..b67bc186 100644 --- a/frontend/src/views/files/FileListing.vue +++ b/frontend/src/views/files/FileListing.vue @@ -298,7 +298,15 @@ import HeaderBar from "@/components/header/HeaderBar.vue"; import Action from "@/components/header/Action.vue"; import Search from "@/components/Search.vue"; import Item from "@/components/files/ListingItem.vue"; -import { computed, inject, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue"; +import { + computed, + inject, + nextTick, + onBeforeUnmount, + onMounted, + ref, + watch, +} from "vue"; import { useRoute } from "vue-router"; import { useI18n } from "vue-i18n"; import { storeToRefs } from "pinia"; @@ -325,19 +333,19 @@ const { t } = useI18n(); const listing = ref(null); const nameSorted = computed(() => - fileStore.req ? fileStore.req.sorting.by === "name" : false, + fileStore.req ? fileStore.req.sorting.by === "name" : false ); const sizeSorted = computed(() => - fileStore.req ? fileStore.req.sorting.by === "size" : false, + fileStore.req ? fileStore.req.sorting.by === "size" : false ); const modifiedSorted = computed(() => - fileStore.req ? fileStore.req.sorting.by === "modified" : false, + fileStore.req ? fileStore.req.sorting.by === "modified" : false ); const ascOrdered = computed(() => - fileStore.req ? fileStore.req.sorting.asc : false, + fileStore.req ? fileStore.req.sorting.asc : false ); const dirs = computed(() => items.value.dirs.slice(0, showLimit.value)); @@ -643,7 +651,7 @@ const colunmsResize = () => { if (items_ === null) return; let columns = Math.floor( - (document.querySelector("main")?.offsetWidth ?? 0) / columnWidth.value, + (document.querySelector("main")?.offsetWidth ?? 0) / columnWidth.value ); if (columns === 0) columns = 1; items_.style.width = `calc(${100 / columns}% - 1em)`; @@ -858,7 +866,6 @@ const fetch = () => { prompt: "fetch", confirm: (format: any) => { layoutStore.closeHovers(); - }, }); }; @@ -951,7 +958,7 @@ const fillWindow = (fit = false) => { // Quantity of items needed to fill 2x of the window height const showQuantity = Math.ceil( - (windowHeight + windowHeight * 2) / itemWeight.value, + (windowHeight + windowHeight * 2) / itemWeight.value ); // Less items to display than current