diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-11 19:18:56 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-08-17 18:56:38 +0200 |
commit | 267cea8153dbd7d5b6263b2fbdaab09a4d2a57da (patch) | |
tree | 294e273bff372e85be2c073a39c336477d8805c0 /apps/files/src/components/FileEntry.vue | |
parent | 28725c46a84db6e733c42e38cbc5e1b7f0e3854b (diff) | |
download | nextcloud-server-267cea8153dbd7d5b6263b2fbdaab09a4d2a57da.tar.gz nextcloud-server-267cea8153dbd7d5b6263b2fbdaab09a4d2a57da.zip |
fix: FileEntry boundariesElement and right click menu
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 | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 6e43d3340c7..e3feda819b8 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -21,7 +21,7 @@ --> <template> - <tr :class="{'list__row--active': active}" class="list__row"> + <tr :class="{'list__row--active': active}" class="list__row" @contextmenu="onRightClick"> <span v-if="source.attributes.failed" class="files-list__row--failed" /> <td class="files-list__row-checkbox"> @@ -100,8 +100,8 @@ <!-- Menu actions --> <NcActions v-if="active" ref="actionsMenu" - :boundaries-element="boundariesElement" - :container="boundariesElement" + :boundaries-element="getBoundariesElement()" + :container="getBoundariesElement()" :disabled="source._loading" :force-name="true" :force-menu="enabledInlineActions.length === 0 /* forceMenu only if no inline actions */" @@ -259,7 +259,6 @@ export default Vue.extend({ return { backgroundFailed: false, backgroundImage: '', - boundariesElement: document.querySelector('.app-content > .files-list'), loading: '', } }, @@ -508,9 +507,6 @@ export default Vue.extend({ // Fetch the preview on init this.debounceIfNotCached() - - // Right click watcher on tr - this.$el.parentNode?.addEventListener?.('contextmenu', this.onRightClick) }, beforeDestroy() { @@ -814,6 +810,15 @@ export default Vue.extend({ } }, + /** + * Making this a function in case the files-list + * reference changes in the future. That way we're + * sure there is one at the time we call it. + */ + getBoundariesElement() { + return document.querySelector('.app-content > .files-list') + }, + t: translate, formatFileSize, }, |