mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +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;
|
||||
parentNotePath?: string;
|
||||
};
|
||||
addNoteListItem: CommandData & {
|
||||
addNewTableColumn: CommandData & {
|
||||
referenceColumn?: ColumnComponent;
|
||||
direction?: "before" | "after";
|
||||
};
|
||||
|
@ -82,14 +82,14 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
|
||||
{
|
||||
title: t("table_view.add-column-to-the-left"),
|
||||
uiIcon: "bx bx-horizontal-left",
|
||||
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", {
|
||||
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
|
||||
referenceColumn: column
|
||||
})
|
||||
},
|
||||
{
|
||||
title: t("table_view.add-column-to-the-right"),
|
||||
uiIcon: "bx bx-horizontal-right",
|
||||
handler: () => getParentComponent(e)?.triggerCommand("addNoteListItem", {
|
||||
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
|
||||
referenceColumn: column,
|
||||
direction: "after"
|
||||
})
|
||||
|
@ -15,7 +15,7 @@ export default function buildFooter(parentNote: FNote) {
|
||||
<span class="bx bx-plus"></span> ${t("table_view.new-row")}
|
||||
</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")}
|
||||
</button>
|
||||
`.trimStart();
|
||||
|
@ -234,7 +234,7 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
console.log("Save attributes", this.newAttribute);
|
||||
}
|
||||
|
||||
addNoteListItemEvent({ referenceColumn, direction }: EventData<"addNoteListItem">) {
|
||||
addNewTableColumnEvent({ referenceColumn, direction }: EventData<"addNewTableColumn">) {
|
||||
const attr: Attribute = {
|
||||
type: "label",
|
||||
name: "label:myLabel",
|
||||
|
Loading…
x
Reference in New Issue
Block a user