This commit is contained in:
yumoqing 2024-07-04 13:34:23 +08:00
parent e2ddd8c775
commit 9ed1f6a125

View File

@ -37,8 +37,9 @@ bricks.Accordion = class extends bricks.VBox {
this.items.push(b); this.items.push(b);
this.add_widget(b); this.add_widget(b);
} }
this.content = new bricks.VBox({}); this.content = new bricks.Filler({});
this.content.set_css('filler'); this.sub_container = new bricks.VScrollPanel({height:'100%'});
this.content.add_widget(this.sub_container);
} }
async change_content(event){ async change_content(event){
var refresh = false; var refresh = false;
@ -61,8 +62,8 @@ bricks.Accordion = class extends bricks.VBox {
c = await bricks.widgetBuild(this.opts.items[pos].content); c = await bricks.widgetBuild(this.opts.items[pos].content);
this.subcontents[name] = c; this.subcontents[name] = c;
} }
this.content.clear_widgets(); this.sub_container.clear_widgets();
this.content.add_widget(c); this.sub_container.add_widget(c);
try { try {
this.remove_widget(this.content); this.remove_widget(this.content);
} }