aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-05-30 12:16:23 +0200
committerAndy Scherzinger <info@andy-scherzinger.de>2024-06-11 18:13:13 +0200
commit9142ad65f4470f3a2fee29060e72b99691e9b51b (patch)
tree6f9b60d55d83473913356d170e205c828794bdf4
parent907a12b51f5a8bae819ab4b8778e92b4931b0888 (diff)
downloadnextcloud-server-9142ad65f4470f3a2fee29060e72b99691e9b51b.tar.gz
nextcloud-server-9142ad65f4470f3a2fee29060e72b99691e9b51b.zip
fix(files): reset menu pos when opening in grid mode
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r--apps/files/src/components/FileEntryMixin.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts
index 2e34f757f9e..0f5c21536a5 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -157,15 +157,6 @@ export default defineComponent({
return this.actionsMenuStore.opened === this.uniqueId.toString()
},
set(opened) {
- // Only reset when opening a new menu
- if (opened) {
- // Reset any right click position override on close
- // Wait for css animation to be done
- const root = this.$el?.closest('main.app-content') as HTMLElement
- root.style.removeProperty('--mouse-pos-x')
- root.style.removeProperty('--mouse-pos-y')
- }
-
this.actionsMenuStore.opened = opened ? this.uniqueId.toString() : null
},
},
@@ -216,6 +207,11 @@ export default defineComponent({
// 200 = max width of the menu
root.style.setProperty('--mouse-pos-x', Math.max(0, event.clientX - contentRect.left - 200) + 'px')
root.style.setProperty('--mouse-pos-y', Math.max(0, event.clientY - contentRect.top) + 'px')
+ } else {
+ // Reset any right menu position potentially set
+ const root = this.$el?.closest('main.app-content') as HTMLElement
+ root.style.removeProperty('--mouse-pos-x')
+ root.style.removeProperty('--mouse-pos-y')
}
// If the clicked row is in the selection, open global menu