|
@ -1325,12 +1325,14 @@ $.fn.dropdown = function(parameters) { |
|
|
? value |
|
|
? value |
|
|
: text |
|
|
: text |
|
|
; |
|
|
; |
|
|
module.set.selected(value, $(this)); |
|
|
|
|
|
if(module.is.multiple() && !module.is.allFiltered()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.hideAndClear(); |
|
|
|
|
|
|
|
|
if( module.can.activate( $(this) ) ) { |
|
|
|
|
|
module.set.selected(value, $(this)); |
|
|
|
|
|
if(module.is.multiple() && !module.is.allFiltered()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
module.hideAndClear(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -1369,9 +1371,10 @@ $.fn.dropdown = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
selectionCount: function() { |
|
|
selectionCount: function() { |
|
|
var |
|
|
var |
|
|
values = module.get.values() |
|
|
|
|
|
|
|
|
values = module.get.values(), |
|
|
|
|
|
count |
|
|
; |
|
|
; |
|
|
return ( module.is.multiple() ) |
|
|
|
|
|
|
|
|
count = ( module.is.multiple() ) |
|
|
? $.isArray(values) |
|
|
? $.isArray(values) |
|
|
? values.length |
|
|
? values.length |
|
|
: 0 |
|
|
: 0 |
|
@ -1379,6 +1382,7 @@ $.fn.dropdown = function(parameters) { |
|
|
? 1 |
|
|
? 1 |
|
|
: 0 |
|
|
: 0 |
|
|
; |
|
|
; |
|
|
|
|
|
return count; |
|
|
}, |
|
|
}, |
|
|
transition: function($subMenu) { |
|
|
transition: function($subMenu) { |
|
|
return (settings.transition == 'auto') |
|
|
return (settings.transition == 'auto') |
|
@ -1678,7 +1682,9 @@ $.fn.dropdown = function(parameters) { |
|
|
; |
|
|
; |
|
|
if(selectionCount >= settings.maxSelections) { |
|
|
if(selectionCount >= settings.maxSelections) { |
|
|
module.debug('Maximum selection count reached'); |
|
|
module.debug('Maximum selection count reached'); |
|
|
$item.addClass(className.filtered); |
|
|
|
|
|
|
|
|
if(settings.useLabels) { |
|
|
|
|
|
$item.addClass(className.filtered); |
|
|
|
|
|
} |
|
|
module.add.message(message.maxSelections); |
|
|
module.add.message(message.maxSelections); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
@ -2186,8 +2192,8 @@ $.fn.dropdown = function(parameters) { |
|
|
module.select.nextAvailable($selectedItem); |
|
|
module.select.nextAvailable($selectedItem); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
module.set.text(module.add.variables(message.count)); |
|
|
|
|
|
module.add.value(selectedValue, selectedText, $selected); |
|
|
module.add.value(selectedValue, selectedText, $selected); |
|
|
|
|
|
module.set.text(module.add.variables(message.count)); |
|
|
$selected.addClass(className.active); |
|
|
$selected.addClass(className.active); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -2422,7 +2428,7 @@ $.fn.dropdown = function(parameters) { |
|
|
$item.removeClass(className.active); |
|
|
$item.removeClass(className.active); |
|
|
}, |
|
|
}, |
|
|
filteredItem: function() { |
|
|
filteredItem: function() { |
|
|
if( module.has.maxSelections() ) { |
|
|
|
|
|
|
|
|
if(settings.useLabels && module.has.maxSelections() ) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(settings.useLabels) { |
|
|
if(settings.useLabels) { |
|
@ -2775,6 +2781,18 @@ $.fn.dropdown = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
can: { |
|
|
can: { |
|
|
|
|
|
activate: function($item) { |
|
|
|
|
|
if(settings.useLabels) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
if(!module.has.maxSelections()) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
if(module.has.maxSelections() && $item.hasClass(className.active)) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
return false; |
|
|
|
|
|
}, |
|
|
click: function() { |
|
|
click: function() { |
|
|
return (hasTouch || settings.on == 'click'); |
|
|
return (hasTouch || settings.on == 'click'); |
|
|
}, |
|
|
}, |
|
|