Browse Source

Dropdown will now show when only messsage in menu. Fixed maxSelections from hiding dropdown after selection. #2523

pull/2536/head
jlukic 10 years ago
parent
commit
ecccaf50a3
1 changed files with 16 additions and 6 deletions
  1. 22
      src/definitions/modules/dropdown.js

22
src/definitions/modules/dropdown.js

@ -2544,6 +2544,9 @@ $.fn.dropdown = function(parameters) {
input: function() {
return ($input.length > 0);
},
items: function() {
return ($item.length > 0);
},
menu: function() {
return ($menu.length > 0);
},
@ -2589,6 +2592,9 @@ $.fn.dropdown = function(parameters) {
: $menu.transition && $menu.transition('is animating')
;
},
disabled: function() {
$module.hasClass(className.disabled);
},
focused: function() {
return (document.activeElement === $module[0]);
},
@ -2700,7 +2706,7 @@ $.fn.dropdown = function(parameters) {
return (hasTouch || settings.on == 'click');
},
show: function() {
return !$module.hasClass(className.disabled) && $item.length > 0;
return !module.is.disabled() && (module.has.items() || module.has.message());
},
useAPI: function() {
return $.fn.api !== undefined;
@ -2810,14 +2816,18 @@ $.fn.dropdown = function(parameters) {
},
hideAndClear: function() {
if(module.has.search()) {
if( module.has.maxSelections() ) {
module.remove.searchTerm();
module.hide(function() {
module.remove.filteredItem();
});
}
else {
module.hide();
if(module.has.search()) {
module.hide(function() {
module.remove.filteredItem();
});
}
else {
module.hide();
}
}
},

Loading…
Cancel
Save