aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FilesListTableHeaderActions.vue
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-11-15 01:51:28 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-11-20 19:08:21 +0100
commit675e7a953f15e22578da5e37054fe6a2f34f7de5 (patch)
tree0918e1438c9c9e34fd784ffdfe21a1932a958865 /apps/files/src/components/FilesListTableHeaderActions.vue
parent3822db51742eb12c67b525cab80ec0699e011684 (diff)
downloadnextcloud-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/FilesListTableHeaderActions.vue')
-rw-r--r--apps/files/src/components/FilesListTableHeaderActions.vue14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/files/src/components/FilesListTableHeaderActions.vue b/apps/files/src/components/FilesListTableHeaderActions.vue
index fa5f7d4bd5f..9f5724dc80f 100644
--- a/apps/files/src/components/FilesListTableHeaderActions.vue
+++ b/apps/files/src/components/FilesListTableHeaderActions.vue
@@ -43,10 +43,10 @@ import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import { useRouteParameters } from '../composables/useRouteParameters.ts'
+import { useFileListWidth } from '../composables/useFileListWidth.ts'
import { useActionsMenuStore } from '../store/actionsmenu.ts'
import { useFilesStore } from '../store/files.ts'
import { useSelectionStore } from '../store/selection.ts'
-import filesListWidthMixin from '../mixins/filesListWidth.ts'
import logger from '../logger.ts'
// The registered actions list
@@ -62,10 +62,6 @@ export default defineComponent({
NcLoadingIcon,
},
- mixins: [
- filesListWidthMixin,
- ],
-
props: {
currentView: {
type: Object as PropType<View>,
@@ -81,10 +77,12 @@ export default defineComponent({
const actionsMenuStore = useActionsMenuStore()
const filesStore = useFilesStore()
const selectionStore = useSelectionStore()
+ const fileListWidth = useFileListWidth()
const { directory } = useRouteParameters()
return {
directory,
+ fileListWidth,
actionsMenuStore,
filesStore,
@@ -126,13 +124,13 @@ export default defineComponent({
},
inlineActions() {
- if (this.filesListWidth < 512) {
+ if (this.fileListWidth < 512) {
return 0
}
- if (this.filesListWidth < 768) {
+ if (this.fileListWidth < 768) {
return 1
}
- if (this.filesListWidth < 1024) {
+ if (this.fileListWidth < 1024) {
return 2
}
return 3