fix map() in OptionGroup

This commit is contained in:
rolux 2012-05-22 17:34:25 +02:00
parent a8c5dd4d35
commit 16ab404619

View file

@ -109,8 +109,10 @@ Ox.OptionGroup = function(items, min, max, property) {
value <f> get value
@*/
this.value = function() {
var value = Ox.map(items, function(item) {
return item[property] ? item.id : null;
var value = items.filter(function(item) {
return item[property];
}).function(item) {
return item.id;
});
return max == 1 ? (value.length ? value[0] : '') : value;
};