Browse Source

DESIGN-4355 feat: tooltip提示异步获取

es6
zsmj 2 years ago
parent
commit
4889554cfd
  1. 4
      src/base/single/0.single.js

4
src/base/single/0.single.js

@ -33,8 +33,10 @@ BI.Single = BI.inherit(BI.Widget, {
var title = this.getTitle();
if (title instanceof Promise) {
this.requestingTitle = title;
title.then(resolvedTitle => {
this.mouseOver && showToolTip(this._getTooltipOptions(resolvedTitle));
// 由于是异步的,所以无法避免Promise resolve时机问题,所以设计为:鼠标移出了则不显示,并且只显示最后一次发起的查询结果
this.mouseOver && this.requestingTitle === title && showToolTip(this._getTooltipOptions(resolvedTitle));
});
} else {
showToolTip(this._getTooltipOptions(title));

Loading…
Cancel
Save