mirror of
https://github.com/zadam/trilium.git
synced 2024-12-26 09:12:08 +08:00
Merge remote-tracking branch 'origin/stable'
# Conflicts: # package-lock.json
This commit is contained in:
commit
61aa029582
4 changed files with 21 additions and 1 deletions
|
@ -497,6 +497,16 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
|
|||
await this.renderOwnedAttributes(attributes, false);
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.$editor.trigger('focus');
|
||||
|
||||
this.textEditor.model.change( writer => {
|
||||
const positionAt = writer.createPositionAt(this.textEditor.model.document.getRoot(), 'end');
|
||||
|
||||
writer.setSelection(positionAt);
|
||||
} );
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
|
||||
this.refresh();
|
||||
|
|
|
@ -186,7 +186,9 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||
const activeChild = this.getActiveRibbonWidget();
|
||||
|
||||
if (activeChild && (refreshActiveTab || !wasAlreadyActive)) {
|
||||
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath});
|
||||
activeChild.handleEvent('noteSwitched', {noteContext: this.noteContext, notePath: this.notePath}).then(() => {
|
||||
activeChild.focus?.();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.lastActiveComponentId = null;
|
||||
|
|
|
@ -82,4 +82,8 @@ export default class OwnedAttributeListWidget extends NoteContextAwareWidget {
|
|||
this.getTitle(this.note);
|
||||
}
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.attributeEditorWidget.focus();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -310,6 +310,10 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||
$attr.attr("data-attribute-id", result.attributeId);
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.$widget.find(".promoted-attribute-input:first").focus();
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
|
||||
this.refresh();
|
||||
|
|
Loading…
Reference in a new issue