This commit is contained in:
yumoqing 2024-11-06 21:33:47 +08:00
parent 565fb308a9
commit 6e8b47074f
2 changed files with 5 additions and 2 deletions

View File

@ -11,7 +11,7 @@ bricks.Message = class extends bricks.PopupWindow {
opts.auto_open = true;
super(opts);
this.create_message_widget();
this.panel.set_css('message');
this.set_css('message');
}
create_message_widget(){
var w = new bricks.Filler();
@ -29,7 +29,7 @@ bricks.Message = class extends bricks.PopupWindow {
bricks.Error = class extends bricks.Message {
constructor(opts){
super(opts);
this.panel.set_css('error');
this.set_css('error');
}
}

View File

@ -239,6 +239,7 @@ bricks.Popup = class extends bricks.VBox {
}
this.no_opened = false;
this.set_style('display', 'block');
this.dispatch('opened');
if (this.timeout > 0){
this.auto_task = schedule_once(this.dismiss.bind(this), this.timeout)
}
@ -257,8 +258,10 @@ bricks.Popup = class extends bricks.VBox {
this.auto_task = null;
}
this.set_style('display','none');
this.dispatch('dismissed');
if (this.auto_destroy){
this.destroy();
this.dispatch('destroy');
}
}
destroy(){