diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index ffa4fe73..034962ae 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -88,10 +88,7 @@ const FeatureMixin = { DomEvent.stop(event) const items = this._map.getContextMenuItems(event) items.push('-', ...this.feature.getContextMenuItems(event)) - this._map.contextmenu.open( - [event.originalEvent.pageX, event.originalEvent.pageY], - items - ) + this._map.contextmenu.open(event.originalEvent, items) }, onCommit: function () { diff --git a/umap/static/umap/js/modules/tableeditor.js b/umap/static/umap/js/modules/tableeditor.js index 7c13f5ad..79fb6c54 100644 --- a/umap/static/umap/js/modules/tableeditor.js +++ b/umap/static/umap/js/modules/tableeditor.js @@ -64,7 +64,7 @@ export default class TableEditor extends WithTemplate { action: () => this.deleteProperty(property), }) } - this.contextmenu.open([event.pageX, event.pageY], actions) + this.contextmenu.open(event, actions) } renderHeaders() { diff --git a/umap/static/umap/js/modules/ui/contextmenu.js b/umap/static/umap/js/modules/ui/contextmenu.js index fd61c84a..f02e2b1a 100644 --- a/umap/static/umap/js/modules/ui/contextmenu.js +++ b/umap/static/umap/js/modules/ui/contextmenu.js @@ -15,7 +15,9 @@ export default class ContextMenu extends Positioned { }) } - open([left, top], items) { + open(event, items) { + const left = event.pageX + const top = event.pageY this.container.innerHTML = '' for (const item of items) { if (item === '-') { diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 8057ec2c..5b5737d4 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -1772,10 +1772,7 @@ U.Map = L.Map.extend({ onContextMenu: function (event) { const items = this.getContextMenuItems(event) - this.contextmenu.open( - [event.originalEvent.pageX, event.originalEvent.pageY], - items - ) + this.contextmenu.open(event.originalEvent, items) }, editInOSM: function (e) {