diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-21 15:39:31 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-21 15:49:54 +0200 |
commit | 6e29560475f328f3f2cfe908895287f9c095eadd (patch) | |
tree | 8a03ee23ec87407faa471502105fcb289b77005f /apps/files/src/components/FileEntry.vue | |
parent | 2b726fa2dd1597b53159fbdf14936ee4cfbf4999 (diff) | |
download | nextcloud-server-6e29560475f328f3f2cfe908895287f9c095eadd.tar.gz nextcloud-server-6e29560475f328f3f2cfe908895287f9c095eadd.zip |
feat(files): add sidebar action
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index c42327e8821..215a8fdbbc7 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -95,7 +95,7 @@ <td v-if="isSizeAvailable" :style="{ opacity: sizeOpacity }" class="files-list__row-size" - @click="execDefaultAction"> + @click="openDetailsIfAvailable"> <span>{{ size }}</span> </td> @@ -104,7 +104,7 @@ :key="column.id" :class="`files-list__row-${currentView?.id}-${column.id}`" class="files-list__row-column-custom" - @click="execDefaultAction"> + @click="openDetailsIfAvailable"> <CustomElementRender v-if="active" :current-view="currentView" :render="column.render" @@ -130,6 +130,7 @@ import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' import StarIcon from 'vue-material-design-icons/Star.vue' import Vue from 'vue' +import { ACTION_DETAILS } from '../actions/sidebarAction.ts' import { getFileActions } from '../services/FileAction.ts' import { hashCode } from '../utils/hashUtils.ts' import { isCachedPreview } from '../services/PreviewService.ts' @@ -532,6 +533,15 @@ export default Vue.extend({ } }, + openDetailsIfAvailable(event) { + const detailsAction = this.enabledDefaultActions.find(action => action.id === ACTION_DETAILS) + if (detailsAction) { + event.preventDefault() + event.stopPropagation() + detailsAction.exec(this.source, this.currentView) + } + }, + onSelectionChange(selection) { const newSelectedIndex = this.index const lastSelectedIndex = this.selectionStore.lastSelectedIndex |