fix: FileEntry boundariesElement and right click menu

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/39808/head
John Molakvoæ 2023-08-11 19:18:56 +07:00
parent 28725c46a8
commit 267cea8153
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 12 additions and 7 deletions

@ -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,
},