mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 15:49:00 +02:00
refactor(views/table): rename event
This commit is contained in:
parent
ab093ed9a0
commit
c9b37dcc77
@ -283,7 +283,7 @@ export type CommandMappings = {
|
|||||||
customOpts: CreateNoteOpts;
|
customOpts: CreateNoteOpts;
|
||||||
parentNotePath?: string;
|
parentNotePath?: string;
|
||||||
};
|
};
|
||||||
addNoteListItem: CommandData & {
|
addNewTableColumn: CommandData & {
|
||||||
referenceColumn?: ColumnComponent;
|
referenceColumn?: ColumnComponent;
|
||||||
direction?: "before" | "after";
|
direction?: "before" | "after";
|
||||||
};
|
};
|
||||||
|
@ -82,14 +82,14 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
|
|||||||
{
|
{
|
||||||
title: t("table_view.add-column-to-the-left"),
|
title: t("table_view.add-column-to-the-left"),
|
||||||
uiIcon: "bx bx-horizontal-left",
|
uiIcon: "bx bx-horizontal-left",
|
||||||
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", {
|
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
|
||||||
referenceColumn: column
|
referenceColumn: column
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("table_view.add-column-to-the-right"),
|
title: t("table_view.add-column-to-the-right"),
|
||||||
uiIcon: "bx bx-horizontal-right",
|
uiIcon: "bx bx-horizontal-right",
|
||||||
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", {
|
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
|
||||||
referenceColumn: column,
|
referenceColumn: column,
|
||||||
direction: "after"
|
direction: "after"
|
||||||
})
|
})
|
||||||
|
@ -15,7 +15,7 @@ export default function buildFooter(parentNote: FNote) {
|
|||||||
<span class="bx bx-plus"></span> ${t("table_view.new-row")}
|
<span class="bx bx-plus"></span> ${t("table_view.new-row")}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button class="btn btn-sm" style="padding: 0px 10px 0px 10px;" data-trigger-command="addNoteListItem">
|
<button class="btn btn-sm" style="padding: 0px 10px 0px 10px;" data-trigger-command="addNewTableColumn">
|
||||||
<span class="bx bx-columns"></span> ${t("table_view.new-column")}
|
<span class="bx bx-columns"></span> ${t("table_view.new-column")}
|
||||||
</button>
|
</button>
|
||||||
`.trimStart();
|
`.trimStart();
|
||||||
|
@ -234,7 +234,7 @@ export default class TableView extends ViewMode<StateInfo> {
|
|||||||
console.log("Save attributes", this.newAttribute);
|
console.log("Save attributes", this.newAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
addNoteListItemEvent({ referenceColumn, direction }: EventData<"addNoteListItem">) {
|
addNewTableColumnEvent({ referenceColumn, direction }: EventData<"addNewTableColumn">) {
|
||||||
const attr: Attribute = {
|
const attr: Attribute = {
|
||||||
type: "label",
|
type: "label",
|
||||||
name: "label:myLabel",
|
name: "label:myLabel",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user