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
fix go to external link by double clicking
azivner9029d181780e
diff --git a/public/javascripts/link.js b/public/javascripts/link.jsindex 046d850a8c..a74ce9b702 100644--- a/public/javascripts/link.js+++ b/public/javascripts/link.js@@ -42,18 +42,20 @@ const link = (function() {e.preventDefault();const linkEl = $(e.target);- const notePath = linkEl.attr("note-path") ? linkEl.attr("note-path") : getNotePathFromLink(linkEl.attr('href'));+ const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href');- if (!notePath) {+ if (!address) {return;}- if (notePath.startsWith('http')) {- window.open(notePath, '_blank');+ if (address.startsWith('http')) {+ window.open(address, '_blank');return;}+ const notePath = getNotePathFromLink(address);+noteTree.activateNode(notePath);// this is quite ugly hack, but it seems like we can't close the tooltip otherwise@@ -84,8 +86,8 @@ const link = (function() {// when click on link popup, in case of internal link, just go the the referenced note instead of default behavior// of opening the link in new window/tab$(document).on('click', "a[action='note']", goToLink);- $(document).on('click', 'div.popover-content a, div.ui-tooltip-content', goToLink);- $(document).on('dblclick', '#note-detail a, div.ui-tooltip-content', goToLink);+ $(document).on('click', 'div.popover-content a, div.ui-tooltip-content a', goToLink);+ $(document).on('dblclick', '#note-detail a', goToLink);return {getNodePathFromLabel,