mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
feat(views/table): set up relations not as a link
This commit is contained in:
parent
7f5a1ee45a
commit
e5b10ab16a
@ -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) => {
|
||||
|
@ -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 "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user