Skip to content

Build your personal knowledge base with Trilium Notes

relation promoted attribute has clickable button, fixes #155

azivner0aa08b1c1ed5
diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js
index ed1bb08e7f..d69cd2fe2b 100644
--- a/src/public/javascripts/services/note_detail.js
+++ b/src/public/javascripts/services/note_detail.js
@@ -320,6 +320,16 @@ async function loadAttributes() {
// no need to wait for this
noteAutocompleteService.initNoteAutocomplete($input);
+
+ // ideally we'd use link instead of button which would allow tooltip preview, but
+ // we can't guarantee updating the link in the a element
+ const $openButton = $("<button>").addClass("btn btn-small").text("Open").click(() => {
+ const notePath = linkService.getNotePathFromLabel($input.val());
+
+ treeService.activateNode(notePath);
+ });
+
+ $actionCell.append($openButton);
}
else {
messagingService.logError("Unknown attribute type=" + valueAttr.type);