diff --git a/bricks/layout.js b/bricks/layout.js index d7d5307..3efd315 100644 --- a/bricks/layout.js +++ b/bricks/layout.js @@ -8,6 +8,20 @@ bricks.Layout = class extends bricks.JsWidget { this._container = true; this.children = []; } + build_title(){ + if (this.title){ + this.title_w = new bricks.Title3({otext:this.title, i18n:true, dynsize:true}); + this.add_widget(this.title_w); + } + } + build_description(){ + if (this.description){ + this.description_w = new bricks.Text({otext:this.description, + i18n:true, dynsize:true + }); + this.add_widget(this.description_w); + } + } set_key_select_items(){ this.key_select_items = this.children; } diff --git a/bricks/menu.js b/bricks/menu.js index 549d751..50e6e20 100644 --- a/bricks/menu.js +++ b/bricks/menu.js @@ -11,6 +11,8 @@ bricks.Menu = class extends bricks.VBox { super(options); this.dom_element.style.display = ""; this.dom_element.style.backgroundColor = options.bgcolor || "white"; + this.build_title(); + this.build_description(); this.create_children(this, this.opts.items); this.bind('item_click', this.menu_clicked.bind(this)); } diff --git a/bricks/tree.js b/bricks/tree.js index 2c96838..165f3f7 100644 --- a/bricks/tree.js +++ b/bricks/tree.js @@ -170,6 +170,8 @@ bricks.Tree = class extends bricks.VScrollPanel { this.row_height = this.opts.row_height || '35px'; this.multitype_tree = this.opts.multitype_tree||false; this.selected_node = null; + this.build_title(); + this.build_description(); this.create_toolbar(); this.checked_data = []; this.container = new bricks.VBox({