mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
feat(views/table): drag handle to avoid editing issues
This commit is contained in:
parent
8cced607eb
commit
adfdc7edb4
@ -1,5 +1,5 @@
|
||||
import { RelationEditor } from "./relation_editor.js";
|
||||
import { NoteFormatter, NoteTitleFormatter } from "./formatters.js";
|
||||
import { NoteFormatter, NoteTitleFormatter, RowNumberFormatter } from "./formatters.js";
|
||||
import { applyHeaderMenu } from "./header-menu.js";
|
||||
import type { ColumnDefinition } from "tabulator-tables";
|
||||
import { LabelType } from "../../../services/promoted_attribute_definition_parser.js";
|
||||
@ -46,11 +46,12 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[], exi
|
||||
const columnDefs: ColumnDefinition[] = [
|
||||
{
|
||||
title: "#",
|
||||
formatter: "rownum",
|
||||
headerSort: false,
|
||||
hozAlign: "center",
|
||||
resizable: false,
|
||||
frozen: true
|
||||
frozen: true,
|
||||
rowHandle: true,
|
||||
formatter: RowNumberFormatter
|
||||
},
|
||||
{
|
||||
field: "noteId",
|
||||
@ -79,6 +80,7 @@ export function buildColumnDefinitions(info: PromotedAttributeInformation[], exi
|
||||
field,
|
||||
title: title ?? name,
|
||||
editor: "input",
|
||||
rowHandle: false,
|
||||
...labelTypeMappings[type ?? "text"],
|
||||
});
|
||||
seenFields.add(field);
|
||||
|
@ -36,6 +36,10 @@ export function NoteTitleFormatter(cell: CellComponent) {
|
||||
return $noteRef[0].outerHTML;
|
||||
}
|
||||
|
||||
export function RowNumberFormatter(cell: CellComponent) {
|
||||
return `<span class="bx bx-dots-vertical-rounded"></span> ` + cell.getRow().getPosition(true);
|
||||
}
|
||||
|
||||
function buildNoteLink(noteId: string) {
|
||||
const $noteRef = $("<span>");
|
||||
const href = `#root/${noteId}`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user