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