aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-05-30 12:16:23 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-06-04 13:48:03 +0000
commitaf5a29e5684a30272c96d6d84187fa87ae790d62 (patch)
treeab03268d522e67d2af9c0a33988c4a6ab51b2874 /apps
parent57cd95f804cd2e8fe6e955dc032b1fbc73024a19 (diff)
downloadnextcloud-server-af5a29e5684a30272c96d6d84187fa87ae790d62.tar.gz
nextcloud-server-af5a29e5684a30272c96d6d84187fa87ae790d62.zip
fix(files): reset menu pos when opening in grid mode
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-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 24f84a1a5c9..f91bd4e540f 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -139,15 +139,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
},
},
@@ -198,6 +189,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