add style option to Label

This commit is contained in:
rolux 2011-11-30 15:42:54 +01:00
parent aaded38a5f
commit cba3dc23f6

View file

@ -16,17 +16,24 @@ Ox.Label = function(options, self) {
id: '', id: '',
overlap: 'none', overlap: 'none',
textAlign: 'left', textAlign: 'left',
style: 'rounded',
title: '', title: '',
width: 'auto' width: 'auto'
}) })
.options(options || {}) .options(options || {})
.addClass( .addClass(
'OxLabel' + (self.options.disabled ? ' OxDisabled' : '') + 'OxLabel Ox' + Ox.toTitleCase(self.options.style)
(self.options.overlap != 'none' ? + (self.options.disabled ? ' OxDisabled' : '')
' OxOverlap' + Ox.toTitleCase(self.options.overlap) : '') + (
self.options.overlap != 'none'
?
' OxOverlap' + Ox.toTitleCase(self.options.overlap) : ''
)
) )
.css(Ox.extend(self.options.width == 'auto' ? {} : { .css(Ox.extend(self.options.width == 'auto' ? {} : {
width: self.options.width - 14 + 'px' // fixme: why 14???? width: self.options.width - (
self.options.style == 'rounded' ? 14 : 6
) + 'px'
}, { }, {
textAlign: self.options.textAlign textAlign: self.options.textAlign
})) }))