feat(note_tooltip): clickable note title (closes #1063)

This commit is contained in:
Elian Doran 2025-02-07 21:44:17 +02:00
parent 02d16d0125
commit 0dbd136b48
No known key found for this signature in database
3 changed files with 9 additions and 1 deletions

View File

@ -361,6 +361,10 @@ function linkContextMenu(e: PointerEvent) {
const $link = $(e.target as any).closest("a");
const url = $link.attr("href") || $link.attr("data-href");
if ($link.attr("data-no-context-menu")) {
return;
}
const { notePath, viewScope } = parseNavigationStateFromUrl(url);
if (!notePath) {

View File

@ -155,7 +155,7 @@ async function renderTooltip(note: FNote | null) {
if (isContentEmpty) {
classes.push("note-no-content");
}
content = `<h5 class="${classes.join(" ")}">${noteTitleWithPathAsSuffix.prop("outerHTML")}</h5>`;
content = `<h5 class="${classes.join(" ")}"><a href="#${note.noteId}" data-no-context-menu="true">${noteTitleWithPathAsSuffix.prop("outerHTML")}</a></h5>`;
}
content = `${content}<div class="note-tooltip-attributes">${$renderedAttributes[0].outerHTML}</div>`;

View File

@ -1214,6 +1214,10 @@ body .calendar-dropdown-widget .calendar-body a:hover {
flex-direction: column-reverse;
}
.note-tooltip-title a {
color: inherit !important;
}
.note-tooltip-title.note-no-content {
margin: 0;
}