|
|
|
@ -9,6 +9,9 @@
|
|
|
|
|
* @extends BI.Widget |
|
|
|
|
* @abstract |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
var delayingTooltips; |
|
|
|
|
|
|
|
|
|
BI.Single = BI.inherit(BI.Widget, { |
|
|
|
|
_defaultConfig: function () { |
|
|
|
|
var conf = BI.Single.superclass._defaultConfig.apply(this, arguments); |
|
|
|
@ -30,7 +33,7 @@ BI.Single = BI.inherit(BI.Widget, {
|
|
|
|
|
if (BI.isPlainObject(title)) { |
|
|
|
|
tooltipOpt = title; |
|
|
|
|
} else { |
|
|
|
|
tooltipOpt.level = this.getTipType() || (this.isEnabled() ? "success" : "warning"); |
|
|
|
|
tooltipOpt.level = this.getTipType() || "success"; |
|
|
|
|
tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); |
|
|
|
|
} |
|
|
|
|
if (BI.isKey(tooltipOpt.text)) { |
|
|
|
@ -85,14 +88,16 @@ BI.Single = BI.inherit(BI.Widget, {
|
|
|
|
|
this.element.on("mouseenter.title" + this.getName(), function (e) { |
|
|
|
|
self._e = e; |
|
|
|
|
if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { |
|
|
|
|
delayingTooltips = self.getName(); |
|
|
|
|
self.showTimeout = BI.delay(function () { |
|
|
|
|
if (BI.isNotNull(self.showTimeout)) { |
|
|
|
|
if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
} |
|
|
|
|
}, 200); |
|
|
|
|
} else if (self.getTipType() === "success" || self.isEnabled()) { |
|
|
|
|
delayingTooltips = self.getName(); |
|
|
|
|
self.showTimeout = BI.delay(function () { |
|
|
|
|
if (BI.isNotNull(self.showTimeout)) { |
|
|
|
|
if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { |
|
|
|
|
self._showToolTip(self._e || e, opt); |
|
|
|
|
} |
|
|
|
|
}, 500); |
|
|
|
|