summaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/FileEntry.vue
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-11 19:18:56 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-08-17 18:56:38 +0200
commit267cea8153dbd7d5b6263b2fbdaab09a4d2a57da (patch)
tree294e273bff372e85be2c073a39c336477d8805c0 /apps/files/src/components/FileEntry.vue
parent28725c46a84db6e733c42e38cbc5e1b7f0e3854b (diff)
downloadnextcloud-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.vue19
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,
},