misc bugfixes

This commit is contained in:
rlx 2011-12-23 09:54:20 +00:00
parent 72fe370492
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
);

View file

@ -162,7 +162,6 @@ Ox.TextList = function(options, self) {
id: self.options.id + 'SelectColumns',
items: self.options.columns.map(function(column) {
return {
checked: column.visible,
disabled: column.removable === false,
id: column.id,
title: column.title
@ -170,7 +169,10 @@ Ox.TextList = function(options, self) {
}),
max: -1,
min: 1,
type: 'image'
type: 'image',
value: Ox.map(self.options.columns, function(column) {
return column.visible ? column.id : null;
})
})
.bindEvent('change', changeColumns)
.appendTo(that.$bar.$element);
@ -265,14 +267,14 @@ Ox.TextList = function(options, self) {
function changeColumns(data) {
var add,
ids = [];
Ox.forEach(data.value, function(column) {
var index = getColumnIndexById(column.id);
Ox.forEach(data.value, function(id) {
var index = getColumnIndexById(id);
if (!self.options.columns[index].visible) {
addColumn(column.id);
addColumn(id);
add = true;
return false;
}
ids.push(column.id);
ids.push(id);
});
if (!add) {
Ox.forEach(self.visibleColumns, function(column) {