diff --git a/bricks/popup.js b/bricks/popup.js index 590b3b7..d67bc7c 100644 --- a/bricks/popup.js +++ b/bricks/popup.js @@ -37,7 +37,7 @@ bricks.Popup = class extends bricks.VBox { } open(){ var rect; - var w; + if (this.widget instanceof bricks.Widget){ rect = this.widget.showRectage() this.issub = true; @@ -51,7 +51,6 @@ bricks.Popup = class extends bricks.VBox { rect = bricks.Body.showRectage(); } var lt = archor_at(this.archor); - this.set_style('display', 'block'); if (this.issub){ lt = this.transform2screen_at(rect, lt); if (this.width && this.width.endsWith('%')){ @@ -63,6 +62,7 @@ bricks.Popup = class extends bricks.VBox { } this.set_style('top',lt.top); thos.set_style('left',lt.left); + this.set_style('display', 'block'); if (this.timeout > 0){ this.auto_task = schedule_once(this.auto_dismiss.bind(this), this.timeout) } @@ -72,7 +72,7 @@ bricks.Popup = class extends bricks.VBox { this.auto_task.cancel(); this.auto_task = null; } - this.set_css('display':'none'); + this.set_style('display','none'); } }