From 0dbd136b483c562fdfbb16e912642a83a2088215 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 7 Feb 2025 21:44:17 +0200 Subject: [PATCH] feat(note_tooltip): clickable note title (closes #1063) --- src/public/app/services/link.ts | 4 ++++ src/public/app/services/note_tooltip.ts | 2 +- src/public/stylesheets/theme-next/shell.css | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/public/app/services/link.ts b/src/public/app/services/link.ts index f80a3c10a..da049d52f 100644 --- a/src/public/app/services/link.ts +++ b/src/public/app/services/link.ts @@ -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) { diff --git a/src/public/app/services/note_tooltip.ts b/src/public/app/services/note_tooltip.ts index 39db16bd0..28937f3e2 100644 --- a/src/public/app/services/note_tooltip.ts +++ b/src/public/app/services/note_tooltip.ts @@ -155,7 +155,7 @@ async function renderTooltip(note: FNote | null) { if (isContentEmpty) { classes.push("note-no-content"); } - content = `
${noteTitleWithPathAsSuffix.prop("outerHTML")}
`; + content = `
${noteTitleWithPathAsSuffix.prop("outerHTML")}
`; } content = `${content}
${$renderedAttributes[0].outerHTML}
`; diff --git a/src/public/stylesheets/theme-next/shell.css b/src/public/stylesheets/theme-next/shell.css index 8b703eb85..acf7818f0 100644 --- a/src/public/stylesheets/theme-next/shell.css +++ b/src/public/stylesheets/theme-next/shell.css @@ -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; }