fix refreshing ribbon titles upon entity change, closes #2274

This commit is contained in:
zadam 2021-10-26 20:14:56 +02:00
parent 6135de8507
commit 7ec20f9384
2 changed files with 4 additions and 7 deletions

View file

@ -1,5 +1,6 @@
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import keyboardActionsService from "../../services/keyboard_actions.js";
import attributeService from "../../services/attributes.js";
const TPL = `
<div class="ribbon-container">
@ -261,10 +262,6 @@ export default class RibbonContainer extends NoteContextAwareWidget {
return $ribbonComponent.hasClass("active");
}
refreshRibbonContainerCommand() {
this.refreshWithNote(this.note, true);
}
ensureOwnedAttributesAreOpen(ntxId) {
if (this.isNoteContext(ntxId) && !this.isRibbonTabActive('ownedAttributes')) {
this.toggleRibbonTabWithName('ownedAttributes', ntxId);
@ -332,6 +329,9 @@ export default class RibbonContainer extends NoteContextAwareWidget {
this.refresh();
}
else if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
this.refreshWithNote(this.note, true);
}
}
getActiveRibbonWidget() {

View file

@ -297,9 +297,6 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
entitiesReloadedEvent({loadResults}) {
if (loadResults.getAttributes(this.componentId).find(attr => attributeService.isAffecting(attr, this.note))) {
this.refresh();
this.getTitle(this.note);
this.triggerCommand('refreshRibbonContainer');
}
}
}