mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
refactor(views/table): use slightly more performant formatter for row number
This commit is contained in:
parent
8d29c5fe1b
commit
28f4aea3d5
@ -51,7 +51,7 @@ export function buildColumnDefinitions(info: AttributeDefinitionInformation[], m
|
||||
resizable: false,
|
||||
frozen: true,
|
||||
rowHandle: movableRows,
|
||||
formatter: RowNumberFormatter
|
||||
formatter: RowNumberFormatter(movableRows)
|
||||
},
|
||||
{
|
||||
field: "noteId",
|
||||
|
@ -36,13 +36,15 @@ export function NoteTitleFormatter(cell: CellComponent) {
|
||||
return $noteRef[0].outerHTML;
|
||||
}
|
||||
|
||||
export function RowNumberFormatter(cell: CellComponent) {
|
||||
let html = "";
|
||||
if (cell.getColumn().getDefinition().rowHandle) {
|
||||
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
|
||||
}
|
||||
html += cell.getRow().getPosition(true);
|
||||
return html;
|
||||
export function RowNumberFormatter(draggableRows: boolean) {
|
||||
return (cell: CellComponent) => {
|
||||
let html = "";
|
||||
if (draggableRows) {
|
||||
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
|
||||
}
|
||||
html += cell.getRow().getPosition(true);
|
||||
return html;
|
||||
};
|
||||
}
|
||||
|
||||
function buildNoteLink(noteId: string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user