mirror of
https://github.com/umap-project/umap.git
synced 2025-04-30 12:12:36 +02:00
fix: allow to call contextmenu with given positions
This commit is contained in:
parent
c844e1c03d
commit
3c0d2b79ef
2 changed files with 6 additions and 1 deletions
|
@ -15,9 +15,14 @@ export default class ContextMenu extends Positioned {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
open(event, items) {
|
||||
const left = event.clientX
|
||||
const top = event.clientY
|
||||
this.openAt([left, top], items)
|
||||
}
|
||||
|
||||
openAt([left, top], items) {
|
||||
this.container.innerHTML = ''
|
||||
for (const item of items) {
|
||||
if (item === '-') {
|
||||
|
|
|
@ -663,7 +663,7 @@ const ControlsMixin = {
|
|||
button.addEventListener('click', () => {
|
||||
const x = button.offsetLeft
|
||||
const y = button.offsetTop + button.offsetHeight
|
||||
menu.open([x, y], actions)
|
||||
menu.openAt([x, y], actions)
|
||||
})
|
||||
}
|
||||
this.help.getStartedLink(rightContainer)
|
||||
|
|
Loading…
Reference in a new issue