mirror of
https://github.com/zadam/trilium.git
synced 2025-12-21 23:09:09 +08:00
20 lines
717 B
TypeScript
20 lines
717 B
TypeScript
export default class AttributeEditorWidget extends NoteContextAwareWidget implements EventListener<"entitiesReloaded">, EventListener<"addNewLabel">, EventListener<"addNewRelation"> {
|
|
|
|
// triggered from keyboard shortcut
|
|
async addNewLabelEvent({ ntxId }: EventData<"addNewLabel">) {
|
|
if (this.isNoteContext(ntxId)) {
|
|
await this.refresh();
|
|
|
|
this.handleAddNewAttributeCommand("addNewLabel");
|
|
}
|
|
}
|
|
|
|
// triggered from keyboard shortcut
|
|
async addNewRelationEvent({ ntxId }: EventData<"addNewRelation">) {
|
|
if (this.isNoteContext(ntxId)) {
|
|
await this.refresh();
|
|
|
|
this.handleAddNewAttributeCommand("addNewRelation");
|
|
}
|
|
}
|
|
}
|