Browse Source

Merge pull request #106962 in DEC/fineui from master to feature/x

* commit '87bc4da806485021d751b6e4fbca62241d59e508':
  无JIRA 解决一下single嵌套导致的tooltip一闪的问题.
  update ts
  BI-109153 feat: bi工程内,因为禁用而置灰的按钮, 对应的tooltip要改为正常底色
es6
superman 2 years ago
parent
commit
b52bae00da
  1. 11
      src/base/single/0.single.js
  2. 8
      typescript/core/base.ts

11
src/base/single/0.single.js

@ -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);

8
typescript/core/base.ts

@ -1,7 +1,7 @@
import { _Widget } from "./widget";
export interface _base {
assert: (v: any, is: Function) => Boolean
assert: (v: any, is: Function) => Boolean;
warn: (message: any) => Boolean;
@ -15,7 +15,7 @@ export interface _base {
packageItems: (items: any[], layouts: any[]) => any[];
formatEL: <T>(obj: T) => {el: T} | T
formatEL: <T>(obj: T) => { el: T } | T;
stripEL: <T>(obj: { el: T } | T) => T;
@ -263,7 +263,7 @@ export interface _base {
deepClone: <T>(obj: T) => T;
deepExtend: merge['deepExtend'];
deepExtend: merge["deepExtend"];
isDeepMatch: (object: any, attrs: any) => boolean;
@ -307,7 +307,7 @@ export interface _base {
wrap: (value: any, wrapper: Function) => Function;
nextTick: (func: Function) => Promise<any>;
nextTick: (func?: Function) => Promise<any>;
random: (min?: number, max?: number, floating?: boolean) => number;

Loading…
Cancel
Save