chore(popup_editor): switch keyboard combo to Ctrl+right click

This commit is contained in:
Elian Doran
2025-07-11 16:42:37 +03:00
parent bce2094fb2
commit c7f49f0e21
2 changed files with 17 additions and 15 deletions

View File

@@ -240,20 +240,15 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
this.$tree.on("mousedown", ".fancytree-title", (e) => {
if (e.which === 2) {
const node = $.ui.fancytree.getNode(e as unknown as Event);
const notePath = treeService.getNotePath(node);
if (notePath) {
e.stopPropagation();
e.preventDefault();
if (e.ctrlKey) {
appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath });
} else {
appContext.tabManager.openTabWithNoteWithHoisting(notePath, {
activate: e.shiftKey ? true : false
});
}
appContext.tabManager.openTabWithNoteWithHoisting(notePath, {
activate: e.shiftKey ? true : false
});
}
}
});
@@ -264,11 +259,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
e.preventDefault();
}
});
this.$tree.on("auxclick", (e) => {
// Prevent middle click from pasting in the editor.
e.stopPropagation();
e.preventDefault();
});
this.$treeSettingsPopup = this.$widget.find(".tree-settings-popup");
this.$hideArchivedNotesCheckbox = this.$treeSettingsPopup.find(".hide-archived-notes");
@@ -723,7 +713,13 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
});
} else {
this.$tree.on("contextmenu", ".fancytree-node", (e) => {
this.showContextMenu(e);
if (!e.ctrlKey) {
this.showContextMenu(e);
} else {
const node = $.ui.fancytree.getNode(e as unknown as Event);
const notePath = treeService.getNotePath(node);
appContext.triggerCommand("openInPopup", { noteIdOrPath: notePath });
}
return false; // blocks default browser right click menu
});