fix text list so that it doesn't throw errors in its value function

This commit is contained in:
rlx 2011-11-07 12:15:10 +00:00
parent 77d2d22505
commit 12622724ee
5 changed files with 9 additions and 6 deletions

View file

@ -23,6 +23,8 @@ Ox.Form = function(options, self) {
error: '',
id: '',
items: [],
// FIXME: don't pass function,
// listen to event instead!
submit: null
})
.options(options || {}) // fixme: the || {} can be done once, in the options function

View file

@ -1694,12 +1694,12 @@ Ox.List = function(options, self) {
Ox.Log('List', 'that.value id key value', id, key, value)
var pos = Ox.isNumber(id) ? id : getPositionById(id),
$item = self.$items[pos],
data = $item.options('data');
data = $item ? $item.options('data') : {};
if (arguments.length == 1) {
return data;
} else if (arguments.length == 2) {
return data[key];
} else {
} else if ($item) {
if (key == self.options.unique) {
// unique id has changed
self.options.selected = self.options.selected.map(function(id_) {

View file

@ -140,8 +140,7 @@ Ox.MainMenu = function(options, self) {
checkItem <f> checkItem
@*/
that.checkItem = function(id) {
var ids = id.split('_');
that.getMenu(ids.shift()).checkItem(ids.join('_'));
that.getItem(id).options({checked: true});
return that;
};

View file

@ -315,8 +315,7 @@ Ox.VideoEditor = function(options, self) {
selectAnnotation(data);
},
submit: updateAnnotation
});
self.$annotationPanel[i]
})
.appendTo(self.$annotations);
});

View file

@ -721,6 +721,9 @@ Miscellaneous
.OxThemeClassic .OxSelectable.OxSelected {
background: rgb(224, 224, 224);
}
.OxThemeClassic .OxSelectable.OxSelected.OxFocus {
background: rgb(208, 208, 208);
}
.OxThemeClassic .OxScreen {
background: rgb(224, 224, 224);