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() {
$(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
$(document).on("click", (e) => {

View File

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