This commit is contained in:
yumoqing 2024-05-17 22:19:51 +08:00
parent a834dfe189
commit 2a3078657f

View File

@ -22,13 +22,13 @@ bricks.Accordion = class extends bricks.VBox {
var items = this.opts.items; var items = this.opts.items;
this.items = []; this.items = [];
this.subcontents = {}; this.subcontents = {};
var item_css = this.opts.css || 'accordion' + '-button'; var item_css = this.opts.item_css || 'accordion' + '-button';
var content_css = this.opts.css || 'accordion' + '-content'; var content_css = this.opts.content_css || 'accordion' + '-content';
for (var i=0; i< items.length; i++){ for (var i=0; i< items.length; i++){
var opts = { var opts = {
name:items[i].name, name:items[i].name,
icon:items[i].icon, icon:items[i].icon,
text:items[i].text, label:items[i].label,
height:'auto', height:'auto',
orientation:'horizontal' orientation:'horizontal'
} }
@ -38,8 +38,9 @@ bricks.Accordion = class extends bricks.VBox {
this.add_widget(b); this.add_widget(b);
} }
this.content = new bricks.VBox({}); this.content = new bricks.VBox({});
this.content.set_css('filler');
} }
async change_content(evnet){ async change_content(event){
var b = event.target.bricks_widget; var b = event.target.bricks_widget;
var name = b.opts.name; var name = b.opts.name;
bricks.debug('accordion: button=', b, 'name=', name); bricks.debug('accordion: button=', b, 'name=', name);