mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
update section container on attribute change, closes #1646
This commit is contained in:
parent
1af98056bb
commit
3b4fa0c5fc
@ -122,7 +122,7 @@ export default class CollapsibleSectionContainer extends TabAwareWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note, noExplicitActivation = false) {
|
||||||
let $sectionToActivate, $lastActiveSection;
|
let $sectionToActivate, $lastActiveSection;
|
||||||
|
|
||||||
this.$titleContainer.empty().append('<div class="section-title section-title-empty">');
|
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($sectionTitle);
|
||||||
this.$titleContainer.append('<div class="section-title section-title-empty">');
|
this.$titleContainer.append('<div class="section-title section-title-empty">');
|
||||||
|
|
||||||
if (ret.activate && !$sectionToActivate) {
|
if (ret.activate && !$sectionToActivate && !noExplicitActivation) {
|
||||||
$sectionToActivate = $sectionTitle;
|
$sectionToActivate = $sectionTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,4 +161,8 @@ export default class CollapsibleSectionContainer extends TabAwareWidget {
|
|||||||
this.$bodyContainer.find('.section-body').removeClass("active");
|
this.$bodyContainer.find('.section-body').removeClass("active");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshSectionContainerCommand() {
|
||||||
|
this.refreshWithNote(this.note, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,6 +293,7 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
|||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
||||||
this.renderTitle(this.note);
|
this.renderTitle(this.note);
|
||||||
|
this.triggerCommand('refreshSectionContainer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user