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(){
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');
}
}