mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-15 04:45:06 +01:00
show context menu on right click only
This commit is contained in:
parent
77a7191ce4
commit
f9f022171f
1 changed files with 5 additions and 3 deletions
|
|
@ -26,9 +26,11 @@ export function activate(ctx: ApplicationContext) {
|
|||
|
||||
|
||||
|
||||
let showMenu = true;
|
||||
let showMenu = false;
|
||||
dom.viewerContainer.addEventListener('mousedown', (e) => {
|
||||
showMenu = true;
|
||||
if (e.which == 3 || e.button == 2) {
|
||||
showMenu = true;
|
||||
}
|
||||
});
|
||||
|
||||
dom.viewerContainer.addEventListener('mousemove', (e) => {
|
||||
|
|
@ -37,7 +39,7 @@ export function activate(ctx: ApplicationContext) {
|
|||
|
||||
dom.viewerContainer.addEventListener('mouseup', (e) => {
|
||||
if (showMenu) {
|
||||
ctx.actionService.run('menu.contextual', {
|
||||
ctx.actionService.run('menu.contextual', {
|
||||
x: e.offsetX,
|
||||
y: e.offsetY
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue