Browse Source

Dropdown module (restore)

This fix restores the input class "default" as well as removing the
selected item from the list in case the default value is empty (used as
placeholder)
pull/1627/head
Marcos Mariano 9 years ago
parent
commit
48401cec66
1 changed files with 10 additions and 2 deletions
  1. 12
      src/definitions/modules/dropdown.js

12
src/definitions/modules/dropdown.js

@ -900,6 +900,7 @@ $.fn.dropdown = function(parameters) {
; ;
module.debug('Restoring default text', defaultText); module.debug('Restoring default text', defaultText);
module.set.text(defaultText); module.set.text(defaultText);
$text.addClass(settings.className.placeholder);
}, },
defaultValue: function() { defaultValue: function() {
var var
@ -907,8 +908,15 @@ $.fn.dropdown = function(parameters) {
; ;
if(defaultValue !== undefined) { if(defaultValue !== undefined) {
module.debug('Restoring default value', defaultValue); module.debug('Restoring default value', defaultValue);
module.set.selected(defaultValue);
module.set.value(defaultValue);
if (defaultValue.length) {
module.set.selected(defaultValue);
module.set.value(defaultValue);
}
else {
module.remove.activeItem();
module.remove.selectedItem();
}
} }
} }
}, },

Loading…
Cancel
Save