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