This commit is contained in:
yumoqing 2024-08-20 18:35:27 +08:00
parent e90e5120c1
commit cf378dd2bd

View File

@ -12,7 +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('click', this.menu_clicked.bind(this)); 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({});
@ -99,7 +99,7 @@ bricks.Menu = class extends bricks.VBox {
} }
regen_menuitem_event(item, event){ regen_menuitem_event(item, event){
console.log('regen_menuitem_event()', item); console.log('regen_menuitem_event()', item);
this.dispatch('click', item); this.dispatch('item_click', item);
event.stopPropagation(); event.stopPropagation();
} }
} }