mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
don't trigger menu items on right click, #3764
This commit is contained in:
parent
79a6baca6f
commit
3192531d4c
@ -99,11 +99,16 @@ class ContextMenu {
|
|||||||
const $item = $("<li>")
|
const $item = $("<li>")
|
||||||
.addClass("dropdown-item")
|
.addClass("dropdown-item")
|
||||||
.append($link)
|
.append($link)
|
||||||
|
.on('contextmenu', e => false)
|
||||||
// important to use mousedown instead of click since the former does not change focus
|
// important to use mousedown instead of click since the former does not change focus
|
||||||
// (especially important for focused text for spell check)
|
// (especially important for focused text for spell check)
|
||||||
.on('mousedown', e => {
|
.on('mousedown', e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
|
if (e.which !== 1) { // only left click triggers menu items
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
this.hide();
|
this.hide();
|
||||||
|
|
||||||
if (item.handler) {
|
if (item.handler) {
|
||||||
|
@ -470,11 +470,7 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
async createNoteBox(noteId, title, x, y) {
|
async createNoteBox(noteId, title, x, y) {
|
||||||
const $link = await linkService.createNoteLink(noteId, {title});
|
const $link = await linkService.createNoteLink(noteId, {title});
|
||||||
$link.mousedown(e => {
|
$link.mousedown(e => linkService.goToLink(e));
|
||||||
console.log(e);
|
|
||||||
|
|
||||||
linkService.goToLink(e);
|
|
||||||
});
|
|
||||||
|
|
||||||
const note = await froca.getNote(noteId);
|
const note = await froca.getNote(noteId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user