mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
Merge branch 'master' into next58
# Conflicts: # libraries/ckeditor/ckeditor.js # libraries/ckeditor/ckeditor.js.map # package-lock.json # package.json # src/public/app/layouts/desktop_layout.js
This commit is contained in:
@@ -17,6 +17,12 @@ async function createNoteLink(notePath, options = {}) {
|
||||
return $("<span>").text("[missing note]");
|
||||
}
|
||||
|
||||
if (!notePath.startsWith("root")) {
|
||||
// all note paths should start with "root/" (except for "root" itself)
|
||||
// used e.g. to find internal links
|
||||
notePath = "root/" + notePath;
|
||||
}
|
||||
|
||||
let noteTitle = options.title;
|
||||
const showTooltip = options.showTooltip === undefined ? true : options.showTooltip;
|
||||
const showNotePath = options.showNotePath === undefined ? false : options.showNotePath;
|
||||
@@ -97,8 +103,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 +124,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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user