This commit is contained in:
yumoqing 2024-10-28 17:05:34 +08:00
parent 76c3554a61
commit 7489da5bd6

View File

@ -16,6 +16,14 @@ bricks.Popup = class extends bricks.VBox {
this.set_css('popup'); this.set_css('popup');
const zindex = bricks.app.new_zindex(); const zindex = bricks.app.new_zindex();
this.set_style('zIndex', zindex); this.set_style('zIndex', zindex);
if (this.auto_dismiss){
bricks.Body.bind('click', this.click_outside.bind(this));
}
}
click_outside(event){
if (event.target != this.dom_element){
this.dismiss();
}
} }
add_widget(w, index){ add_widget(w, index){
super.add_widget(w, index); super.add_widget(w, index);