mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Change position
This commit is contained in:
parent
f202fa0d89
commit
15de97c10f
1 changed files with 8 additions and 1 deletions
|
|
@ -80,7 +80,14 @@ export function Header(props: { zen?: boolean }) {
|
|||
|
||||
const handleLogoContextMenu = (event: MouseEvent) => {
|
||||
event.preventDefault()
|
||||
setStore("contextMenuPosition", { x: event.clientX, y: event.clientY })
|
||||
const logoElement = (event.currentTarget as HTMLElement).querySelector("a")
|
||||
if (logoElement) {
|
||||
const rect = logoElement.getBoundingClientRect()
|
||||
setStore("contextMenuPosition", {
|
||||
x: rect.left - 16,
|
||||
y: rect.bottom + 8,
|
||||
})
|
||||
}
|
||||
setStore("contextMenuOpen", true)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue