aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
authorEric Hagman2013-06-26 09:49:21 -0400
committerBrian Ford2013-08-12 12:00:47 -0700
commit01cd34957e778a2fa8d26e2805c2dd5a7f986465 (patch)
tree1b2c636ca694fd8571cffb462438558aebf1051c /src/jqLite.js
parent864517e5a273348c81cd1504e5a7af4359a38ec7 (diff)
downloadangular.js-01cd34957e778a2fa8d26e2805c2dd5a7f986465.tar.bz2
fix(jqLite): return array from multi select in val()
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 1bcd9224..5626f8fe 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -479,6 +479,15 @@ forEach({
val: function(element, value) {
if (isUndefined(value)) {
+ if (nodeName_(element) === 'SELECT' && element.multiple) {
+ var result = [];
+ forEach(element.options, function (option) {
+ if (option.selected) {
+ result.push(option.value || option.text);
+ }
+ });
+ return result.length === 0 ? null : result;
+ }
return element.value;
}
element.value = value;