update section container on attribute change, closes #1646

This commit is contained in:
zadam 2021-02-16 20:58:17 +01:00
parent 1af98056bb
commit 3b4fa0c5fc
3 changed files with 7 additions and 2 deletions

View file

@ -122,7 +122,7 @@ export default class CollapsibleSectionContainer extends TabAwareWidget {
});
}
async refreshWithNote(note) {
async refreshWithNote(note, noExplicitActivation = false) {
let $sectionToActivate, $lastActiveSection;
this.$titleContainer.empty().append('<div class="section-title section-title-empty">');
@ -141,7 +141,7 @@ export default class CollapsibleSectionContainer extends TabAwareWidget {
this.$titleContainer.append($sectionTitle);
this.$titleContainer.append('<div class="section-title section-title-empty">');
if (ret.activate && !$sectionToActivate) {
if (ret.activate && !$sectionToActivate && !noExplicitActivation) {
$sectionToActivate = $sectionTitle;
}
@ -161,4 +161,8 @@ export default class CollapsibleSectionContainer extends TabAwareWidget {
this.$bodyContainer.find('.section-body').removeClass("active");
}
}
refreshSectionContainerCommand() {
this.refreshWithNote(this.note, true);
}
}

View file

@ -293,6 +293,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
this.refresh();
this.renderTitle(this.note);
this.triggerCommand('refreshSectionContainer');
}
}
}