fixing a bug where selects would report an incorrect value

This commit is contained in:
rlx 2011-01-15 06:47:22 +00:00
parent bb9f04b7e8
commit f71af0a205

View file

@ -4397,10 +4397,10 @@ requires
}; };
that.selected = function() { that.selected = function() {
return $.map(/*self.checked*/self.optionGroup.checked(), function(v, i) { return $.map(/*self.checked*/self.optionGroup.checked(), function(v) {
return { return {
id: self.options.items[i].id, id: self.options.items[v].id,
title: self.options.items[i].title title: self.options.items[v].title
}; };
}); });
}; };
@ -4482,10 +4482,10 @@ requires
} }
that.value = function() { that.value = function() {
return $.map(self.options.elements, function(input) { return $.map(self.options.elements, function(element) {
var ret = null; var ret = null;
['checked', 'selected', 'value'].forEach(function(v) { ['checked', 'selected', 'value'].forEach(function(v) {
input[v] && (ret = input[v]()); element[v] && (ret = element[v]());
}); });
return ret; return ret;
}); });