Skip to content

Commit 0dbd136

Browse files
committed
feat(note_tooltip): clickable note title (closes #1063)
1 parent 02d16d0 commit 0dbd136

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/public/app/services/link.ts

+4
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ function linkContextMenu(e: PointerEvent) {
361361
const $link = $(e.target as any).closest("a");
362362
const url = $link.attr("href") || $link.attr("data-href");
363363

364+
if ($link.attr("data-no-context-menu")) {
365+
return;
366+
}
367+
364368
const { notePath, viewScope } = parseNavigationStateFromUrl(url);
365369

366370
if (!notePath) {

src/public/app/services/note_tooltip.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async function renderTooltip(note: FNote | null) {
155155
if (isContentEmpty) {
156156
classes.push("note-no-content");
157157
}
158-
content = `<h5 class="${classes.join(" ")}">${noteTitleWithPathAsSuffix.prop("outerHTML")}</h5>`;
158+
content = `<h5 class="${classes.join(" ")}"><a href="#${note.noteId}" data-no-context-menu="true">${noteTitleWithPathAsSuffix.prop("outerHTML")}</a></h5>`;
159159
}
160160

161161
content = `${content}<div class="note-tooltip-attributes">${$renderedAttributes[0].outerHTML}</div>`;

src/public/stylesheets/theme-next/shell.css

+4
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,10 @@ body .calendar-dropdown-widget .calendar-body a:hover {
12141214
flex-direction: column-reverse;
12151215
}
12161216

1217+
.note-tooltip-title a {
1218+
color: inherit !important;
1219+
}
1220+
12171221
.note-tooltip-title.note-no-content {
12181222
margin: 0;
12191223
}

0 commit comments

Comments
 (0)