FormElementGroup: support setting value via .value()

This commit is contained in:
rolux 2015-02-14 19:51:55 +00:00
parent 35b0c46eac
commit 91d3f438b7

View file

@ -115,12 +115,18 @@ Ox.FormElementGroup = function(options, self) {
value <f> value
@*/
that.value = function() {
var values = self.options.elements.map(function(element) {
var values;
if (arguments.length == 0) {
values = self.options.elements.map(function(element) {
return element.value ? element.value() : void 0;
});
return self.options.joinValues
? self.options.joinValues(values)
return self.options.join
? self.options.join(values)
: values;
} else {
setValue();
return that;
}
};
return that;