From 51db6761c810df31122a00d77eb2d03575db9ed6 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 6 Apr 2021 20:18:16 +0200 Subject: [PATCH] fix opening links with single click outside of the ckeditor instance --- src/public/app/services/link.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index 99ce1bfe3..6a8711714 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -74,8 +74,12 @@ function goToLink(e) { const $link = $(e.target).closest("a,.block-link"); + console.log("zzzzz", $link); + const notePath = getNotePathFromLink($link); + console.log() + if (notePath) { if ((e.which === 1 && e.ctrlKey) || e.which === 2) { appContext.tabManager.openTabWithNoteWithHoisting(notePath); @@ -88,9 +92,12 @@ function goToLink(e) { else { if ((e.which === 1 && e.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 ) { const address = $link.attr('href'); + console.log("address", address); + if (address) { if (address.toLowerCase().startsWith('http')) { window.open(address, '_blank');