From 6e8b47074f716f1dd9b611394c129f958f8a676b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 6 Nov 2024 21:33:47 +0800 Subject: [PATCH] bugfix --- bricks/message.js | 4 ++-- bricks/popup.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bricks/message.js b/bricks/message.js index 54c3c44..5f9ee08 100644 --- a/bricks/message.js +++ b/bricks/message.js @@ -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'); } } diff --git a/bricks/popup.js b/bricks/popup.js index f33b8e2..a0c0046 100644 --- a/bricks/popup.js +++ b/bricks/popup.js @@ -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(){