Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
don't trigger menu items on right click, #3764
zadam3192531d4c32
diff --git a/src/public/app/menus/context_menu.js b/src/public/app/menus/context_menu.jsindex ba42cc345d..19b5f64334 100644--- a/src/public/app/menus/context_menu.js+++ b/src/public/app/menus/context_menu.js@@ -99,11 +99,16 @@ class ContextMenu {const $item = $("<li>").addClass("dropdown-item").append($link)+ .on('contextmenu', e => false)// important to use mousedown instead of click since the former does not change focus// (especially important for focused text for spell check).on('mousedown', e => {e.stopPropagation();+ if (e.which !== 1) { // only left click triggers menu items+ return false;+ }+this.hide();if (item.handler) {diff --git a/src/public/app/widgets/type_widgets/relation_map.js b/src/public/app/widgets/type_widgets/relation_map.jsindex aa9d68a064..696ad250d2 100644--- a/src/public/app/widgets/type_widgets/relation_map.js+++ b/src/public/app/widgets/type_widgets/relation_map.js@@ -470,11 +470,7 @@ export default class RelationMapTypeWidget extends TypeWidget {async createNoteBox(noteId, title, x, y) {const $link = await linkService.createNoteLink(noteId, {title});- $link.mousedown(e => {- console.log(e);-- linkService.goToLink(e);- });+ $link.mousedown(e => linkService.goToLink(e));const note = await froca.getNote(noteId);