Skip to content

Commit

Permalink
improved positioning of context menu for template control
Browse files Browse the repository at this point in the history
  • Loading branch information
ishubin committed Feb 5, 2025
1 parent 19a743f commit 3ba9854
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/ui/components/SchemeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3335,16 +3335,12 @@ export default {
this.schemeContainer.updateEditBox();
},

mouseCoordsFromEvent(event) {
const p = mouseCoordsFromEvent(event);
onEditBoxChoiceControlClicked({options, editBoxId, event, callback}) {
let p = mouseCoordsFromEvent(event);
if (!p) {
return this.mouseCoordsFromPageCoords(0, 0);
p = {x: 0, y: 0};
}
return this.mouseCoordsFromPageCoords(p.x, p.y);
},

onEditBoxChoiceControlClicked({options, editBoxId, event, callback}) {
const p = this.mouseCoordsFromEvent(event);
this.$emit('context-menu-requested', p.x, p.y, options.map(option => {
return {
name: option,
Expand Down

0 comments on commit 3ba9854

Please sign in to comment.