mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix refreshing ribbon titles upon entity change, closes #2274
This commit is contained in:
parent
6135de8507
commit
7ec20f9384
@ -1,5 +1,6 @@
|
|||||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||||
import keyboardActionsService from "../../services/keyboard_actions.js";
|
import keyboardActionsService from "../../services/keyboard_actions.js";
|
||||||
|
import attributeService from "../../services/attributes.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="ribbon-container">
|
<div class="ribbon-container">
|
||||||
@ -261,10 +262,6 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||||||
return $ribbonComponent.hasClass("active");
|
return $ribbonComponent.hasClass("active");
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshRibbonContainerCommand() {
|
|
||||||
this.refreshWithNote(this.note, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ensureOwnedAttributesAreOpen(ntxId) {
|
ensureOwnedAttributesAreOpen(ntxId) {
|
||||||
if (this.isNoteContext(ntxId) && !this.isRibbonTabActive('ownedAttributes')) {
|
if (this.isNoteContext(ntxId) && !this.isRibbonTabActive('ownedAttributes')) {
|
||||||
this.toggleRibbonTabWithName('ownedAttributes', ntxId);
|
this.toggleRibbonTabWithName('ownedAttributes', ntxId);
|
||||||
@ -332,6 +329,9 @@ export default class RibbonContainer extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
else if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
|
||||||
|
this.refreshWithNote(this.note, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getActiveRibbonWidget() {
|
getActiveRibbonWidget() {
|
||||||
|
@ -297,9 +297,6 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
entitiesReloadedEvent({loadResults}) {
|
entitiesReloadedEvent({loadResults}) {
|
||||||
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
|
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
||||||
this.getTitle(this.note);
|
|
||||||
this.triggerCommand('refreshRibbonContainer');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user