|
|
|
@ -36,6 +36,7 @@
|
|
|
|
|
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
|
|
|
|
|
clear: false, // 是否去掉边框和背景
|
|
|
|
|
ghost: false, // 是否幽灵显示, 即正常状态无背景
|
|
|
|
|
loading: false, // 是否处于加载中
|
|
|
|
|
textAlign: "center", |
|
|
|
|
whiteSpace: "nowrap", |
|
|
|
|
textWidth: null, |
|
|
|
@ -46,9 +47,8 @@
|
|
|
|
|
bgap: 0, |
|
|
|
|
lgap: 0, |
|
|
|
|
rgap: 0, |
|
|
|
|
iconGap: 4, |
|
|
|
|
iconPosition: "left", |
|
|
|
|
iconSize: props.iconSize |
|
|
|
|
iconGap: 8, |
|
|
|
|
iconPosition: "left" |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -74,19 +74,12 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (BI.isKey(o.iconCls)) { |
|
|
|
|
var iconCss = {}; |
|
|
|
|
if (o.iconSize) { |
|
|
|
|
iconCss.fontSize = o.iconSize / BI.pixRatio + BI.pixUnit; |
|
|
|
|
} |
|
|
|
|
this.icon = BI.createWidget({ |
|
|
|
|
type: "bi.icon_label", |
|
|
|
|
cls: o.iconCls, |
|
|
|
|
width: o.iconWidth, |
|
|
|
|
height: o.iconHeight, |
|
|
|
|
lineHeight: o.iconHeight, |
|
|
|
|
iconWidth: o.iconSize, |
|
|
|
|
iconHeight: o.iconSize, |
|
|
|
|
css: iconCss |
|
|
|
|
width: this._const.iconWidth, |
|
|
|
|
height: lineHeight, |
|
|
|
|
lineHeight: lineHeight |
|
|
|
|
}); |
|
|
|
|
this.text = BI.createWidget({ |
|
|
|
|
type: "bi.label", |
|
|
|
@ -150,6 +143,9 @@
|
|
|
|
|
if (o.ghost === true) { |
|
|
|
|
this.element.addClass("ghost"); |
|
|
|
|
} |
|
|
|
|
if (o.loading === true) { |
|
|
|
|
this.element.addClass("loading"); |
|
|
|
|
} |
|
|
|
|
if (o.minWidth > 0) { |
|
|
|
|
this.element.css({"min-width": o.minWidth / BI.pixRatio + BI.pixUnit}); |
|
|
|
|
} |
|
|
|
@ -171,6 +167,14 @@
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setLoading: function (loading) { |
|
|
|
|
if(loading) { |
|
|
|
|
this.element.addClass("loading"); |
|
|
|
|
} else { |
|
|
|
|
this.element.removeClass("loading"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setText: function (text) { |
|
|
|
|
BI.Button.superclass.setText.apply(this, arguments); |
|
|
|
|
this.text.setText(text); |
|
|
|
|