|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
(function () { |
|
|
|
function isVertical(position) { |
|
|
|
function isVertical(position) { |
|
|
|
return position === "top" || position === "bottom"; |
|
|
|
return position === "top" || position === "bottom"; |
|
|
|
} |
|
|
|
} |
|
|
@ -19,7 +20,6 @@ BI.Button = BI.inherit(BI.BasicButton, { |
|
|
|
_defaultConfig: function (props) { |
|
|
|
_defaultConfig: function (props) { |
|
|
|
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); |
|
|
|
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return BI.extend(conf, { |
|
|
|
return BI.extend(conf, { |
|
|
|
baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), |
|
|
|
baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), |
|
|
|
attributes: { |
|
|
|
attributes: { |
|
|
@ -48,12 +48,12 @@ BI.Button = BI.inherit(BI.BasicButton, { |
|
|
|
rgap: 0, |
|
|
|
rgap: 0, |
|
|
|
iconGap: 4, |
|
|
|
iconGap: 4, |
|
|
|
iconPosition: "left", |
|
|
|
iconPosition: "left", |
|
|
|
iconSize: props.iconSize || 12 |
|
|
|
iconSize: props.iconSize |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
var o = this.options, self = this; |
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
|
|
|
|
// 由于button默认情况下有个边框,所以要主动算行高
|
|
|
|
// 由于button默认情况下有个边框,所以要主动算行高
|
|
|
|
var lineHeight, textHeight = o.textHeight; |
|
|
|
var lineHeight, textHeight = o.textHeight; |
|
|
@ -74,17 +74,19 @@ BI.Button = BI.inherit(BI.BasicButton, { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
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: o.iconWidth, |
|
|
|
height: o.iconHeight, |
|
|
|
height: o.iconHeight, |
|
|
|
lineHeight: o.iconHeight, |
|
|
|
lineHeight: o.iconHeight, |
|
|
|
iconWidth: o.iconWidth, |
|
|
|
iconWidth: o.iconSize, |
|
|
|
iconHeight: o.iconHeight, |
|
|
|
iconHeight: o.iconSize, |
|
|
|
css: { |
|
|
|
css: iconCss |
|
|
|
fontSize: o.iconSize + "px" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
|
type: "bi.label", |
|
|
|
type: "bi.label", |
|
|
@ -199,3 +201,4 @@ BI.Button = BI.inherit(BI.BasicButton, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.shortcut("bi.button", BI.Button); |
|
|
|
BI.shortcut("bi.button", BI.Button); |
|
|
|
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; |
|
|
|
|
|
|
|
}()); |
|
|
|