mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 13:39:01 +01:00
fix(views/table): color no longer shown for reference links
This commit is contained in:
parent
f405682ec1
commit
3d264379cc
@ -20,9 +20,7 @@ export function NoteFormatter(cell: CellComponent, _formatterParams, onRendered)
|
|||||||
|
|
||||||
const iconClass = note.getIcon();
|
const iconClass = note.getIcon();
|
||||||
const title = note.title;
|
const title = note.title;
|
||||||
const { $noteRef } = buildNoteLink(noteId);
|
const { $noteRef } = buildNoteLink(noteId, title, iconClass, note.getColorClass());
|
||||||
$noteRef.text(title);
|
|
||||||
$noteRef.prepend($("<span>").addClass(iconClass));
|
|
||||||
return $noteRef[0];
|
return $noteRef[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,10 +56,7 @@ export function NoteTitleFormatter(cell: CellComponent) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const { $noteRef } = buildNoteLink(noteId);
|
const { $noteRef } = buildNoteLink(noteId, cell.getValue(), iconClass);
|
||||||
$noteRef.text(cell.getValue());
|
|
||||||
$noteRef.prepend($("<span>").addClass(iconClass));
|
|
||||||
|
|
||||||
return $noteRef[0].outerHTML;
|
return $noteRef[0].outerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,10 +75,15 @@ export function MonospaceFormatter(cell: CellComponent) {
|
|||||||
return `<code>${cell.getValue()}</code>`;
|
return `<code>${cell.getValue()}</code>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildNoteLink(noteId: string) {
|
function buildNoteLink(noteId: string, title: string, iconClass: string, colorClass?: string) {
|
||||||
const $noteRef = $("<span>");
|
const $noteRef = $("<span>");
|
||||||
const href = `#root/${noteId}`;
|
const href = `#root/${noteId}`;
|
||||||
$noteRef.addClass("reference-link");
|
$noteRef.addClass("reference-link");
|
||||||
$noteRef.attr("data-href", href);
|
$noteRef.attr("data-href", href);
|
||||||
|
$noteRef.text(title);
|
||||||
|
$noteRef.prepend($("<span>").addClass(iconClass));
|
||||||
|
if (colorClass) {
|
||||||
|
$noteRef.addClass(colorClass);
|
||||||
|
}
|
||||||
return { $noteRef, href };
|
return { $noteRef, href };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user