From 76c3554a61a8cebb30bd9a92ba89cfd3afe4c0ae Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 28 Oct 2024 16:55:14 +0800 Subject: [PATCH] bugfix --- bricks/widget.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bricks/widget.js b/bricks/widget.js index 2f2a563..84683a4 100755 --- a/bricks/widget.js +++ b/bricks/widget.js @@ -76,6 +76,7 @@ bricks.JsWidget = class { "x", "y", "height", + "cursor", "margin", "marginLeft", "marginRight", @@ -451,6 +452,7 @@ bricks.Tooltip = class extends bricks.Text { super(opts); this.set_css('modal'); this.set_style('minWidth', '90px'); + this.auto_task = null; } show(otext, event){ this.set_otext(otext); @@ -476,9 +478,16 @@ bricks.Tooltip = class extends bricks.Text { } this.set_style('left', x + 'px'); this.set_style('top', y + 'px'); + if (this.auto_task){ + this.auto_task.cancel(); + } + this.auto_task = schedule_once(this.hide.bind(this), 30); } hide(){ - console.log('moveout event happen'); + if (this.auto_task){ + this.auto_task.cancel(); + this.auto_task = null; + } this.set_style('display', 'none'); } }