aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry
diff options
context:
space:
mode:
authorVarun Patil <varunpatil@ucla.edu>2023-10-17 19:03:48 -0700
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-10-19 08:23:22 +0200
commit4876eacf3fee0f4bbbaa70f924e5429133f1d1bd (patch)
tree81b894543ff13fda039376ab8c5b22fd7f26c994 /apps/files/src/components/FileEntry
parent1c014f82c2343bd3661ad1366171709a42eed076 (diff)
downloadnextcloud-server-4876eacf3fee0f4bbbaa70f924e5429133f1d1bd.tar.gz
nextcloud-server-4876eacf3fee0f4bbbaa70f924e5429133f1d1bd.zip
perf(files): performance optimizations
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
Diffstat (limited to 'apps/files/src/components/FileEntry')
-rw-r--r--apps/files/src/components/FileEntry/FileEntryActions.vue11
-rw-r--r--apps/files/src/components/FileEntry/FileEntryPreview.vue8
2 files changed, 11 insertions, 8 deletions
diff --git a/apps/files/src/components/FileEntry/FileEntryActions.vue b/apps/files/src/components/FileEntry/FileEntryActions.vue
index bcb4abef10f..404936f485b 100644
--- a/apps/files/src/components/FileEntry/FileEntryActions.vue
+++ b/apps/files/src/components/FileEntry/FileEntryActions.vue
@@ -35,8 +35,8 @@
<!-- Menu actions -->
<NcActions v-if="visible"
ref="actionsMenu"
- :boundaries-element="getBoundariesElement()"
- :container="getBoundariesElement()"
+ :boundaries-element="getBoundariesElement"
+ :container="getBoundariesElement"
:disabled="isLoading || loading !== ''"
:force-name="true"
:force-menu="enabledInlineActions.length === 0 /* forceMenu only if no inline actions */"
@@ -70,6 +70,8 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
+import CustomElementRender from '../CustomElementRender.vue'
+
import logger from '../../logger.js'
// The registered actions list
@@ -83,6 +85,7 @@ export default Vue.extend({
NcActions,
NcIconSvgWrapper,
NcLoadingIcon,
+ CustomElementRender,
},
props: {
@@ -182,9 +185,7 @@ export default Vue.extend({
this.$emit('update:opened', value)
},
},
- },
- methods: {
/**
* Making this a function in case the files-list
* reference changes in the future. That way we're
@@ -193,7 +194,9 @@ export default Vue.extend({
getBoundariesElement() {
return document.querySelector('.app-content > table.files-list')
},
+ },
+ methods: {
actionDisplayName(action: FileAction) {
if (this.filesListWidth < 768 && action.inline && typeof action.title === 'function') {
// if an inline action is rendered in the menu for
diff --git a/apps/files/src/components/FileEntry/FileEntryPreview.vue b/apps/files/src/components/FileEntry/FileEntryPreview.vue
index 076319428e5..8a7af255ec2 100644
--- a/apps/files/src/components/FileEntry/FileEntryPreview.vue
+++ b/apps/files/src/components/FileEntry/FileEntryPreview.vue
@@ -22,9 +22,9 @@
<template>
<span class="files-list__row-icon">
<template v-if="source.type === 'folder'">
- <FolderOpenIcon v-if="dragover" />
+ <FolderOpenIcon v-once v-if="dragover" />
<template v-else>
- <FolderIcon />
+ <FolderIcon v-once />
<OverlayIcon :is="folderOverlay"
v-if="folderOverlay"
class="files-list__row-icon-overlay" />
@@ -41,13 +41,13 @@
@error="backgroundFailed = true"
@load="backgroundFailed = false">
- <FileIcon v-else />
+ <FileIcon v-once v-else />
<!-- Favorite icon -->
<span v-if="isFavorite"
class="files-list__row-icon-favorite"
:aria-label="t('files', 'Favorite')">
- <FavoriteIcon />
+ <FavoriteIcon v-once />
</span>
</span>
</template>