mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
feat(note_tooltip): clickable note title (closes #1063)
This commit is contained in:
parent
02d16d0125
commit
0dbd136b48
@ -361,6 +361,10 @@ function linkContextMenu(e: PointerEvent) {
|
|||||||
const $link = $(e.target as any).closest("a");
|
const $link = $(e.target as any).closest("a");
|
||||||
const url = $link.attr("href") || $link.attr("data-href");
|
const url = $link.attr("href") || $link.attr("data-href");
|
||||||
|
|
||||||
|
if ($link.attr("data-no-context-menu")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { notePath, viewScope } = parseNavigationStateFromUrl(url);
|
const { notePath, viewScope } = parseNavigationStateFromUrl(url);
|
||||||
|
|
||||||
if (!notePath) {
|
if (!notePath) {
|
||||||
|
@ -155,7 +155,7 @@ async function renderTooltip(note: FNote | null) {
|
|||||||
if (isContentEmpty) {
|
if (isContentEmpty) {
|
||||||
classes.push("note-no-content");
|
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>`;
|
content = `${content}<div class="note-tooltip-attributes">${$renderedAttributes[0].outerHTML}</div>`;
|
||||||
|
@ -1214,6 +1214,10 @@ body .calendar-dropdown-widget .calendar-body a:hover {
|
|||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-tooltip-title a {
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
.note-tooltip-title.note-no-content {
|
.note-tooltip-title.note-no-content {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user