mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
help buttons and existing custom HTML attribute refactoring to data-*
This commit is contained in:
@@ -33,8 +33,8 @@ async function createNoteLink(notePath, noteTitle = null) {
|
||||
const noteLink = $("<a>", {
|
||||
href: 'javascript:',
|
||||
text: noteTitle
|
||||
}).attr('action', 'note')
|
||||
.attr('note-path', notePath);
|
||||
}).attr('data-action', 'note')
|
||||
.attr('data-note-path', notePath);
|
||||
|
||||
return noteLink;
|
||||
}
|
||||
@@ -43,10 +43,10 @@ function goToLink(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const $link = $(e.target);
|
||||
let notePath = $link.attr("note-path");
|
||||
let notePath = $link.attr("data-note-path");
|
||||
|
||||
if (!notePath) {
|
||||
const address = $link.attr("note-path") ? $link.attr("note-path") : $link.attr('href');
|
||||
const address = $link.attr("data-note-path") ? $link.attr("data-note-path") : $link.attr('href');
|
||||
|
||||
if (!address) {
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ ko.bindingHandlers.noteLink = {
|
||||
|
||||
// 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', "a[data-action='note']", goToLink);
|
||||
$(document).on('click', 'div.popover-content a, div.ui-tooltip-content a', goToLink);
|
||||
$(document).on('dblclick', '#note-detail-text a', goToLink);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user