From 16140a3d9a90031c2c78566d40a5377ac90d85e0 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 16 Aug 2019 15:11:40 +0800 Subject: [PATCH] =?UTF-8?q?BI-49840=20fix:=20title=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=A4=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/single.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/base/single/single.js b/src/base/single/single.js index 598174e64..20891c3c4 100644 --- a/src/base/single/single.js +++ b/src/base/single/single.js @@ -37,6 +37,11 @@ BI.Single = BI.inherit(BI.Widget, { } }, + _getShowTitle: function() { + var type = this.getTipType() || (this.isEnabled() ? "success" : "warning"); + return type === "success" ? this.getTitle() : (this.getWarningTitle() || this.getTitle()); + }, + _hideTooltip: function () { var self = this; var tooltip = BI.Tooltips.get(this.getName()); @@ -89,6 +94,8 @@ BI.Single = BI.inherit(BI.Widget, { } }, 500); } + // 如果当前控件设置了title, 那么最终显示的是当前title,而不应该是祖先的title + BI.isKey(self._getShowTitle()) && e.stopPropagation(); }); this.element.on("mousemove.title" + this.getName(), function (e) { self._e = e; @@ -114,7 +121,8 @@ BI.Single = BI.inherit(BI.Widget, { self._showToolTip(self._e || e, opt); } }, 500); - + // 如果当前控件设置了title, 那么最终显示的是当前title,而不应该是祖先的title + BI.isKey(self._getShowTitle()) && e.stopPropagation(); }); this.element.on("mouseleave.title" + this.getName(), function (e) {