1
0
Fork 0
forked from 0x2620/oxjs

misc bugfixes

This commit is contained in:
rlx 2011-12-23 09:54:20 +00:00
commit 84e7e794f7
3 changed files with 14 additions and 15 deletions

View file

@ -106,7 +106,7 @@ Ox.Checkbox = function(options, self) {
} else if (key == 'title') {
self.$title.options({title: value});
} else if (key == 'value') {
self.$button.toggleTitle();
self.$button.toggle();
} else if (key == 'width') {
that.css({width: value + 'px'});
self.$title && self.$title.options({width: getTitleWidth()});

View file

@ -76,14 +76,14 @@ Ox.Select = function(options, self) {
self.options.items = self.options.items.map(function(item) {
return Ox.isEmpty(item) ? item : {
id: item.id || item,
title: item.title || item,
checked: Ox.toArray(self.options.value).indexOf(item.id || item) > -1
id: 'id' in item ? item.id : item,
title: 'title' in item ? item.title : item,
checked: Ox.toArray(self.options.value).indexOf(
'id' in item ? 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,
@ -93,8 +93,6 @@ 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',
@ -154,7 +152,6 @@ Ox.Select = function(options, self) {
function changeMenu(data) {
self.options.value = self.optionGroup.value();
Ox.Log('Form', 'changeMenu: ', data, 'value:', self.options.value, 'checked:', self.optionGroup.checked())
self.$title && self.$title.html(
self.options.title ? self.options.title : getItem(self.options.value).title
);