mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 15:05:31 +08:00
double click on an external link opens it
This commit is contained in:
parent
d953d96fa6
commit
cabb78b3e4
1 changed files with 12 additions and 0 deletions
|
@ -149,6 +149,18 @@ async function loadReferenceLinkTitle(noteId, $el) {
|
|||
$(document).on('click', "a", goToLink);
|
||||
$(document).on('auxclick', "a", goToLink); // to handle middle button
|
||||
$(document).on('contextmenu', 'a', linkContextMenu);
|
||||
$(document).on('dblclick', "a", e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const $link = $(e.target).closest("a");
|
||||
|
||||
const address = $link.attr('href');
|
||||
|
||||
if (address && address.startsWith('http')) {
|
||||
window.open(address, '_blank');
|
||||
}
|
||||
});
|
||||
|
||||
export default {
|
||||
getNotePathFromUrl,
|
||||
|
|
Loading…
Reference in a new issue