diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-03-28 12:28:49 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-04-06 14:49:32 +0200 |
commit | 4942747ff85dc8671ff7a6a42cd07a886d361b07 (patch) | |
tree | 7bde2642b6657b5e95abf872f638555839c02f9d /apps | |
parent | 7215a9ae9c5803c20aa81fbfb227ad1546863620 (diff) | |
download | nextcloud-server-4942747ff85dc8671ff7a6a42cd07a886d361b07.tar.gz nextcloud-server-4942747ff85dc8671ff7a6a42cd07a886d361b07.zip |
fix(files): use inline NcActions
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index b0324a6ab4a..420af67f9eb 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -58,21 +58,12 @@ <!-- Actions --> <td :class="`files-list__row-actions-${uniqueId}`" class="files-list__row-actions"> <!-- Inline actions --> - <template v-for="action in enabledInlineActions"> - <!-- TODO: implement CustomElementRender --> - <NcButton :key="action.id" - type="tertiary" - @click="onActionClick(action)"> - <template #icon> - <NcLoadingIcon v-if="loading === action.id" :size="18" /> - <CustomSvgIconRender v-else :svg="action.iconSvgInline([source], currentView)" /> - </template> - {{ action.displayName([source], currentView) }} - </NcButton> - </template> + <!-- TODO: implement CustomElementRender --> <!-- Menu actions --> - <NcActions ref="actionsMenu" :force-menu="true"> + <NcActions ref="actionsMenu" + :force-title="true" + :inline="enabledInlineActions.length"> <NcActionButton v-for="action in enabledMenuActions" :key="action.id" :class="'files-list__row-action-' + action.id" @@ -280,15 +271,17 @@ export default Vue.extend({ .sort((a, b) => (a.order || 0) - (b.order || 0)) }, - enabledMenuActions() { - return actions - .filter(action => !action.inline) - }, - enabledInlineActions() { return this.enabledActions.filter(action => action?.inline?.(this.source, this.currentView)) }, + enabledMenuActions() { + return [ + ...this.enabledInlineActions, + ...actions.filter(action => !action.inline), + ] + }, + uniqueId() { return this.hashCode(this.source.source) }, @@ -305,7 +298,7 @@ export default Vue.extend({ return } // Restore default tabindex - this.$el.parentNode.style.removeProperty('display') + this.$el.parentNode.style.display = '' }, /** * When the source changes, reset the preview |