diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index f8dc73d2d..fabfc2628 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -97,8 +97,10 @@ function goToLink(e) { const notePath = getNotePathFromLink($link); + const ctrlKey = (!utils.isMac() && e.ctrlKey) || (utils.isMac() && e.metaKey); + if (notePath) { - if ((e.which === 1 && e.ctrlKey) || e.which === 2) { + if ((e.which === 1 && ctrlKey) || e.which === 2) { appContext.tabManager.openTabWithNoteWithHoisting(notePath); } else if (e.which === 1) { @@ -116,7 +118,7 @@ function goToLink(e) { } } else { - if ((e.which === 1 && e.ctrlKey) || e.which === 2 + if ((e.which === 1 && ctrlKey) || e.which === 2 || $link.hasClass("ck-link-actions__preview") // within edit link dialog single click suffices || $link.closest("[contenteditable]").length === 0 // outside of CKEditor single click suffices ) { diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index 561189882..576aa7da7 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -343,7 +343,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { node.setFocus(true); } - else if (event.ctrlKey) { + else if ((!utils.isMac() && event.ctrlKey) || (utils.isMac() && event.metaKey)) { const notePath = treeService.getNotePath(node); appContext.tabManager.openTabWithNoteWithHoisting(notePath); }