This commit is contained in:
yumoqing 2024-08-28 18:22:20 +08:00
parent 59358b4692
commit a3a3bc5ffc

View File

@ -12,6 +12,7 @@ bricks.Menu = class extends bricks.VBox {
this.dom_element.style.display = ""; this.dom_element.style.display = "";
this.dom_element.style.backgroundColor = options.bgcolor || "white"; this.dom_element.style.backgroundColor = options.bgcolor || "white";
this.create_children(this, this.opts.items); this.create_children(this, this.opts.items);
this.bind('item_click', this.menu_clicked.bind(this));
} }
create_submenu_container(){ create_submenu_container(){
let cp = new bricks.VBox({}); let cp = new bricks.VBox({});
@ -89,8 +90,8 @@ bricks.Menu = class extends bricks.VBox {
w[k] = item[k]; w[k] = item[k];
} }
} }
iw.bind('click', this.regen_menuitem_event.bind(this, item)); // iw.bind('click', this.regen_menuitem_event.bind(this, item));
tw.bind('click', this.regen_menuitem_event.bind(this, item)); // tw.bind('click', this.regen_menuitem_event.bind(this, item));
iw.menuitem = w; iw.menuitem = w;
tw.menuitem = w; tw.menuitem = w;
w.set_css(this.menuitem_css || 'menuitem'); w.set_css(this.menuitem_css || 'menuitem');