mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(views/table): wrong position when renaming column
This commit is contained in:
parent
2244f0368f
commit
34f1a84769
@ -81,14 +81,15 @@ export default class TableColumnEditing extends Component {
|
||||
this.api.blockRedraw();
|
||||
|
||||
if (this.existingAttributeToEdit && this.existingAttributeToEdit.name !== name) {
|
||||
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
|
||||
|
||||
const oldName = this.existingAttributeToEdit.name.split(":")[1];
|
||||
const newName = name.split(":")[1];
|
||||
await renameColumn(this.parentNote.noteId, type, oldName, newName);
|
||||
}
|
||||
|
||||
attributes.setLabel(this.parentNote.noteId, name, value);
|
||||
if (this.existingAttributeToEdit) {
|
||||
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
|
||||
}
|
||||
this.api.restoreRedraw();
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,7 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
|
||||
uiIcon: "bx bx-edit",
|
||||
enabled: !!column.getField() && column.getField() !== "title",
|
||||
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
|
||||
referenceColumn: column,
|
||||
columnToEdit: column
|
||||
})
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user