feat(views/table): set up relations not as a link

This commit is contained in:
Elian Doran 2025-07-04 20:08:41 +03:00
parent 7f5a1ee45a
commit e5b10ab16a
No known key found for this signature in database
2 changed files with 8 additions and 5 deletions

View File

@ -14,6 +14,7 @@ let dismissTimer: ReturnType<typeof setTimeout>;
function setupGlobalTooltip() { function setupGlobalTooltip() {
$(document).on("mouseenter", "a", mouseEnterHandler); $(document).on("mouseenter", "a", mouseEnterHandler);
$(document).on("mouseenter", "[data-href]", mouseEnterHandler);
// close any note tooltip after click, this fixes the problem that sometimes tooltips remained on the screen // close any note tooltip after click, this fixes the problem that sometimes tooltips remained on the screen
$(document).on("click", (e) => { $(document).on("click", (e) => {

View File

@ -58,11 +58,13 @@ export function RelationFormatter(cell: CellComponent, formatterParams, onRender
} }
onRendered(async () => { onRendered(async () => {
const $link = $("<a>"); const $noteRef = $("<span>");
$link.addClass("reference-link"); const href = `#root/${noteId}`;
$link.attr("href", `#root/${noteId}`); $noteRef.addClass("reference-link");
await loadReferenceLinkTitle($link); $noteRef.attr("data-href", href);
cell.getElement().appendChild($link[0]);
await loadReferenceLinkTitle($noteRef, href);
cell.getElement().appendChild($noteRef[0]);
}); });
return ""; return "";
} }