forked from 0x2620/oxjs
use new form element syntax, continued
This commit is contained in:
parent
e47305c93f
commit
02f53a57c1
15 changed files with 107 additions and 88 deletions
|
|
@ -75,13 +75,15 @@ Ox.Select = function(options, self) {
|
|||
Ox.Log('Form', 'Ox.Select', self.options);
|
||||
|
||||
self.options.items = self.options.items.map(function(item) {
|
||||
return {
|
||||
return Ox.isEmpty(item) ? item : {
|
||||
id: item.id || item,
|
||||
title: item.title || item,
|
||||
checked: Ox.toArray(self.options.value).indexOf(item.id || item) > -1
|
||||
};
|
||||
});
|
||||
|
||||
Ox.Log('Form', 'S.O.V.', '"'+self.options.value+'"', JSON.stringify(self.options.items))
|
||||
|
||||
self.optionGroup = new Ox.OptionGroup(
|
||||
self.options.items,
|
||||
self.options.min,
|
||||
|
|
@ -91,6 +93,8 @@ Ox.Select = function(options, self) {
|
|||
self.options.items = self.optionGroup.init();
|
||||
self.options.value = self.optionGroup.value();
|
||||
|
||||
Ox.Log('Form', 'S.O.V.', '"'+self.options.value+'"', JSON.stringify(self.options.items))
|
||||
|
||||
if (self.options.label) {
|
||||
self.$label = Ox.Label({
|
||||
overlap: 'right',
|
||||
|
|
@ -102,7 +106,6 @@ Ox.Select = function(options, self) {
|
|||
}
|
||||
|
||||
if (self.options.type == 'text') {
|
||||
Ox.Log('Form', 'S.O.V.', self.options.value)
|
||||
self.$title = $('<div>')
|
||||
.addClass('OxTitle')
|
||||
.css({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue