forked from 0x2620/oxjs
fix css for selects with labels, allow for checkboxes with labels
This commit is contained in:
parent
0b53fc0566
commit
54b7d9de9f
6 changed files with 81 additions and 38 deletions
|
|
@ -8,6 +8,8 @@ Ox.Select <f:Ox.Element> Select Object
|
|||
options <o> Options object
|
||||
id <s> element id
|
||||
items <a|[]> items
|
||||
label <s|''> Label
|
||||
labelWidth <n|64> Label width
|
||||
max <n|1> minimum number of selected items
|
||||
min <n|1> maximum number of selected items
|
||||
overlap <s|'none'> can be none, left or right
|
||||
|
|
@ -32,6 +34,8 @@ Ox.Select = function(options, self) {
|
|||
.defaults({
|
||||
id: '',
|
||||
items: [],
|
||||
label: '',
|
||||
labelWidth: 64,
|
||||
max: 1,
|
||||
min: 1,
|
||||
overlap: 'none', // can be none, left or right
|
||||
|
|
@ -46,9 +50,10 @@ Ox.Select = function(options, self) {
|
|||
// or allow for extra action items below options
|
||||
.options(options)
|
||||
.addClass(
|
||||
'OxSelect Ox' + Ox.toTitleCase(self.options.size) +
|
||||
(self.options.overlap == 'none' ? '' : ' OxOverlap' +
|
||||
Ox.toTitleCase(self.options.overlap))
|
||||
'OxSelect Ox' + Ox.toTitleCase(self.options.size) + (
|
||||
self.options.overlap == 'none'
|
||||
? '' : ' OxOverlap' + Ox.toTitleCase(self.options.overlap)
|
||||
) + (self.options.label ? ' OxLabelSelect' : '')
|
||||
)
|
||||
.css(self.options.width == 'auto' ? {} : {
|
||||
width: self.options.width - 2 + 'px'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue