bug fix and performance improvements
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
getClass: function (classPrefix, size, shape, bordered) {
|
||||
var hasPx = (size || '').indexOf('px') > -1;
|
||||
var borderSize = hasPx ? 'medium' : size;
|
||||
var classNames = [
|
||||
classPrefix,
|
||||
classPrefix + (shape === 'round' ? '--round' : '--circle'),
|
||||
bordered ? classPrefix + '--border' + ' ' + classPrefix + '--border-' + borderSize : '',
|
||||
hasPx ? '' : classPrefix + '--' + size,
|
||||
];
|
||||
return classNames.join(' ');
|
||||
},
|
||||
|
||||
getSize: function (size = 'medium') {
|
||||
var pxIndex = size.indexOf('px');
|
||||
if (pxIndex > -1) {
|
||||
return 'width:' + size + ';height:' + size + ';font-size:' + ((size.slice(0, pxIndex) / 8) * 3 + 2) + 'px;';
|
||||
}
|
||||
},
|
||||
|
||||
getStyles: function (isShow, zIndex) {
|
||||
var displayStyle = isShow ? '' : 'display: none;';
|
||||
var zIndexStyle = zIndex ? 'z-index:' + zIndex + ';' : '';
|
||||
return displayStyle + zIndexStyle;
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user