diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2023-09-21 12:15:37 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2023-09-21 15:20:17 +0200 |
commit | 216804f83d5af391a8a4cc56de89280e3fcdd3bf (patch) | |
tree | 909109808f002c3ce269d0a598efa0f830633711 /apps/files | |
parent | a5a8655bebb8652206ea5aa886699f706739e1fe (diff) | |
download | nextcloud-server-216804f83d5af391a8a4cc56de89280e3fcdd3bf.tar.gz nextcloud-server-216804f83d5af391a8a4cc56de89280e3fcdd3bf.zip |
fix(files): title and inline actions
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 83b991dcd50..f9320a55e15 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -130,12 +130,13 @@ :class="'files-list__row-action-' + action.id" :close-after-click="true" :data-cy-files-list-row-action="action.id" + :title="action.title?.([source], currentView)" @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) }} + {{ actionDisplayName(action) }} </NcActionButton> </NcActions> </td> @@ -180,7 +181,7 @@ import { debounce } from 'debounce' import { emit } from '@nextcloud/event-bus' import { extname } from 'path' import { generateUrl } from '@nextcloud/router' -import { getFileActions, DefaultType, FileType, formatFileSize, Permission, Folder, File, Node } from '@nextcloud/files' +import { getFileActions, DefaultType, FileType, formatFileSize, Permission, Folder, File, Node, FileAction } from '@nextcloud/files' import { Type as ShareType } from '@nextcloud/sharing' import { showError, showSuccess } from '@nextcloud/dialogs' import { translate } from '@nextcloud/l10n' @@ -918,6 +919,16 @@ export default Vue.extend({ return document.querySelector('.app-content > .files-list') }, + actionDisplayName(action: FileAction) { + if (this.filesListWidth < 768 && action.inline && typeof action.title === 'function') { + // if an inline action is rendered in the menu for + // lack of space we use the title first if defined + const title = action.title([this.source], this.currentView) + if (title) return title + } + return action.displayName([this.source], this.currentView) + }, + t: translate, formatFileSize, }, |