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