diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index 6ab83d476..73bc29c34 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -132,51 +132,8 @@ function linkContextMenu(e) { }); } -// 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('mousedown', "a[data-action='note']", goToLink); -$(document).on('mousedown', 'div.popover-content a, div.ui-tooltip-content a', goToLink); -$(document).on('dblclick', '.note-detail-text a', goToLink); -$(document).on('mousedown', '.note-detail-text a:not(.reference-link)', function (e) { - const $link = $(e.target).closest("a"); - const notePath = getNotePathFromLink($link); - - if ((e.which === 1 && e.ctrlKey) || e.which === 2) { - // if it's a ctrl-click, then we open on new tab, otherwise normal flow (CKEditor opens link-editing dialog) - e.preventDefault(); - - if (notePath) { - appContext.tabManager.openTabWithNote(notePath, false); - } - else { - const address = $link.attr('href'); - - window.open(address, '_blank'); - } - - return true; - } -}); - -$(document).on('mousedown', 'a.reference-link', goToLink); -$(document).on('mousedown', '.note-detail-book a', goToLink); -$(document).on('mousedown', '.note-detail-render a', goToLink); -$(document).on('mousedown', '.note-detail-readonly-text a', goToLink); -$(document).on('mousedown', 'a.ck-link-actions__preview', goToLink); -$(document).on('click', 'section.include-note a', goToLink); -$(document).on('click', 'a.ck-link-actions__preview', e => { - e.preventDefault(); - e.stopPropagation(); -}); - -$(document).on('contextmenu', 'a.ck-link-actions__preview', linkContextMenu); -$(document).on('contextmenu', '.note-detail-text a', linkContextMenu); -$(document).on('contextmenu', '.note-detail-readonly-text a', linkContextMenu); -$(document).on('contextmenu', 'a.reference-link', linkContextMenu); -$(document).on('contextmenu', "a[data-action='note']", linkContextMenu); -$(document).on('contextmenu', ".note-detail-render a", linkContextMenu); -$(document).on('contextmenu', ".note-paths-widget a", linkContextMenu); -$(document).on('contextmenu', "section.include-note a", linkContextMenu); +$(document).on('mousedown', "a", goToLink); +$(document).on('contextmenu', 'a', linkContextMenu); export default { getNotePathFromUrl, diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js index 143178ec4..1de242b9b 100644 --- a/src/public/app/widgets/type_widgets/editable_text.js +++ b/src/public/app/widgets/type_widgets/editable_text.js @@ -42,23 +42,27 @@ const mentionSetup = { }; const TPL = ` -
+
-
+
`; @@ -80,7 +84,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { doRender() { this.$widget = $(TPL); - this.$editor = this.$widget.find('.note-detail-text-editor'); + this.$editor = this.$widget.find('.note-detail-editable-text-editor'); this.initialized = this.initEditor(); diff --git a/src/public/app/widgets/type_widgets/read_only_text.js b/src/public/app/widgets/type_widgets/read_only_text.js index ffedbaba0..4b5791489 100644 --- a/src/public/app/widgets/type_widgets/read_only_text.js +++ b/src/public/app/widgets/type_widgets/read_only_text.js @@ -20,7 +20,7 @@ const TPL = ` font-family: var(--detail-text-font-family); } - .note-detail-readonly-text p:first-child, .note-detail-text::before { + .note-detail-readonly-text p:first-child, .note-detail-editable-text::before { margin-top: 0; }