Browse Source

Dropdown: Adds enhancement to store dropdown value even in cases without input #404

pull/410/head
jlukic 11 years ago
parent
commit
f47e721b26
1 changed files with 10 additions and 2 deletions
  1. 12
      src/modules/dropdown.js

12
src/modules/dropdown.js

@ -318,7 +318,10 @@ $.fn.dropdown = function(parameters) {
return $text.text();
},
value: function() {
return $input.val();
return ($input.size() > 0)
? $input.val()
: $module.data(metadata.value)
;
},
item: function(value) {
var
@ -364,7 +367,12 @@ $.fn.dropdown = function(parameters) {
},
value: function(value) {
module.debug('Adding selected value to hidden input', value, $input);
$input.val(value);
if($input.size() > 0) {
$input.val(value);
}
else {
$module.data(metadata.value, value);
}
},
active: function() {
$module.addClass(className.active);

Loading…
Cancel
Save