Merge pull request #45666 from nextcloud/backport/45581/stable29

[stable29] fix(files): reset menu pos when opening in grid mode
This commit is contained in:
Andy Scherzinger 2024-06-11 20:05:23 +02:00 committed by GitHub
commit f211e9a767
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 12 deletions

View file

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

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long