This commit is contained in:
yumoqing 2024-10-28 15:51:36 +08:00
parent 640350960a
commit dba6a105cb

View File

@ -37,7 +37,7 @@ bricks.Popup = class extends bricks.VBox {
} }
open(){ open(){
var rect; var rect;
var w;
if (this.widget instanceof bricks.Widget){ if (this.widget instanceof bricks.Widget){
rect = this.widget.showRectage() rect = this.widget.showRectage()
this.issub = true; this.issub = true;
@ -51,7 +51,6 @@ bricks.Popup = class extends bricks.VBox {
rect = bricks.Body.showRectage(); rect = bricks.Body.showRectage();
} }
var lt = archor_at(this.archor); var lt = archor_at(this.archor);
this.set_style('display', 'block');
if (this.issub){ if (this.issub){
lt = this.transform2screen_at(rect, lt); lt = this.transform2screen_at(rect, lt);
if (this.width && this.width.endsWith('%')){ if (this.width && this.width.endsWith('%')){
@ -63,6 +62,7 @@ bricks.Popup = class extends bricks.VBox {
} }
this.set_style('top',lt.top); this.set_style('top',lt.top);
thos.set_style('left',lt.left); thos.set_style('left',lt.left);
this.set_style('display', 'block');
if (this.timeout > 0){ if (this.timeout > 0){
this.auto_task = schedule_once(this.auto_dismiss.bind(this), this.timeout) 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.cancel();
this.auto_task = null; this.auto_task = null;
} }
this.set_css('display':'none'); this.set_style('display','none');
} }
} }