diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-11-15 01:51:28 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-11-20 19:08:21 +0100 |
commit | 675e7a953f15e22578da5e37054fe6a2f34f7de5 (patch) | |
tree | 0918e1438c9c9e34fd784ffdfe21a1932a958865 /apps/files/src/components/FileEntry.vue | |
parent | 3822db51742eb12c67b525cab80ec0699e011684 (diff) | |
download | nextcloud-server-675e7a953f15e22578da5e37054fe6a2f34f7de5.tar.gz nextcloud-server-675e7a953f15e22578da5e37054fe6a2f34f7de5.zip |
refactor(files): Provide `useFileListWidth` composable
Replace the mixin with a composable, this is better typed and works in
both: Options- and Composition API.
Also added component tests for it.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index fc5c7fb97f6..7af76c87c43 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -36,7 +36,6 @@ <FileEntryName ref="name" :basename="basename" :extension="extension" - :files-list-width="filesListWidth" :nodes="nodes" :source="source" @auxclick.native="execDefaultAction" @@ -47,7 +46,6 @@ <FileEntryActions v-show="!isRenamingSmallScreen" ref="actions" :class="`files-list__row-actions-${uniqueId}`" - :files-list-width="filesListWidth" :loading.sync="loading" :opened.sync="openedMenu" :source="source" /> @@ -91,6 +89,7 @@ import { formatFileSize } from '@nextcloud/files' import moment from '@nextcloud/moment' import { useNavigation } from '../composables/useNavigation.ts' +import { useFileListWidth } from '../composables/useFileListWidth.ts' import { useRouteParameters } from '../composables/useRouteParameters.ts' import { useActionsMenuStore } from '../store/actionsmenu.ts' import { useDragAndDropStore } from '../store/dragging.ts' @@ -135,6 +134,7 @@ export default defineComponent({ const filesStore = useFilesStore() const renamingStore = useRenamingStore() const selectionStore = useSelectionStore() + const filesListWidth = useFileListWidth() // The file list is guaranteed to be only shown with active view - thus we can set the `loaded` flag const { currentView } = useNavigation(true) const { @@ -152,6 +152,7 @@ export default defineComponent({ currentDir, currentFileId, currentView, + filesListWidth, } }, |