mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 17:49:02 +01: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,
|
resizable: false,
|
||||||
frozen: true,
|
frozen: true,
|
||||||
rowHandle: movableRows,
|
rowHandle: movableRows,
|
||||||
formatter: RowNumberFormatter
|
formatter: RowNumberFormatter(movableRows)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: "noteId",
|
field: "noteId",
|
||||||
|
|||||||
@ -36,13 +36,15 @@ export function NoteTitleFormatter(cell: CellComponent) {
|
|||||||
return $noteRef[0].outerHTML;
|
return $noteRef[0].outerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RowNumberFormatter(cell: CellComponent) {
|
export function RowNumberFormatter(draggableRows: boolean) {
|
||||||
|
return (cell: CellComponent) => {
|
||||||
let html = "";
|
let html = "";
|
||||||
if (cell.getColumn().getDefinition().rowHandle) {
|
if (draggableRows) {
|
||||||
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
|
html += `<span class="bx bx-dots-vertical-rounded"></span> `;
|
||||||
}
|
}
|
||||||
html += cell.getRow().getPosition(true);
|
html += cell.getRow().getPosition(true);
|
||||||
return html;
|
return html;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildNoteLink(noteId: string) {
|
function buildNoteLink(noteId: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user