|
|
@ -4050,7 +4050,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
}, |
|
|
|
|
|
|
|
filterActive: function() { |
|
|
|
if(settings.filterActive) { |
|
|
|
if(settings.hideSelections) { |
|
|
|
$item.filter('.' + className.active) |
|
|
|
.addClass(className.filtered) |
|
|
|
; |
|
|
@ -4503,7 +4503,6 @@ $.fn.dropdown = function(parameters) { |
|
|
|
? $nextItem = $selectedItem.nextAll(selector.item + ':not(.' + className.filtered + ')').eq(0) |
|
|
|
: $item.eq(0) |
|
|
|
; |
|
|
|
console.log(hasSelectedItem, inVisibleMenu, $nextItem); |
|
|
|
if($nextItem.length === 0) { |
|
|
|
module.verbose('Down key pressed but reached bottom of current menu'); |
|
|
|
event.preventDefault(); |
|
|
@ -4817,7 +4816,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
optionValue = module.get.choiceValue($choice, optionText) |
|
|
|
; |
|
|
|
if(isMultiple) { |
|
|
|
if($.inArray(optionValue, value) !== -1 || $.inArray(optionText, value) !== -1) { |
|
|
|
if($.inArray(optionValue.toString(), value) !== -1 || $.inArray(optionText, value) !== -1) { |
|
|
|
$selectedItem = ($selectedItem) |
|
|
|
? $selectedItem.add($choice) |
|
|
|
: $choice |
|
|
@ -5095,7 +5094,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
module.remove.activeItem(); |
|
|
|
module.remove.selectedItem(); |
|
|
|
} |
|
|
|
else if(settings.filterActive) { |
|
|
|
else if(settings.hideSelections) { |
|
|
|
module.remove.selectedItem(); |
|
|
|
} |
|
|
|
$selectedItem |
|
|
@ -5180,7 +5179,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
$item.removeClass(className.active); |
|
|
|
}, |
|
|
|
filteredItem: function() { |
|
|
|
if(settings.filterActive) { |
|
|
|
if(settings.hideSelections) { |
|
|
|
$item.not('.' + className.active).removeClass(className.filtered); |
|
|
|
} |
|
|
|
else { |
|
|
@ -5200,12 +5199,14 @@ $.fn.dropdown = function(parameters) { |
|
|
|
; |
|
|
|
if($selectedItem) { |
|
|
|
if( $input.is('select') ) { |
|
|
|
module.verbose('Input is <select> removing selected'); |
|
|
|
$input |
|
|
|
.find('option[value="' + selectedValue + '"]') |
|
|
|
.prop('selected', false) |
|
|
|
; |
|
|
|
} |
|
|
|
else { |
|
|
|
module.verbose('Input is csv removing value'); |
|
|
|
values = module.remove.delimitedValue(selectedValue, values); |
|
|
|
$input |
|
|
|
.val(values) |
|
|
@ -5219,7 +5220,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
.removeClass(className.filtered) |
|
|
|
.removeClass(className.active) |
|
|
|
; |
|
|
|
if(!module.filterActive) { |
|
|
|
if(!settings.hideSelections) { |
|
|
|
$selectedItem.removeClass(className.selected); |
|
|
|
} |
|
|
|
} |
|
|
@ -5421,7 +5422,6 @@ $.fn.dropdown = function(parameters) { |
|
|
|
module.verbose('Automatically determining animation based on animation direction', settings.transition); |
|
|
|
} |
|
|
|
if(settings.transition == 'none') { |
|
|
|
console.log(settings.transition); |
|
|
|
start(); |
|
|
|
$currentMenu.transition('show'); |
|
|
|
callback.call(element); |
|
|
@ -5717,69 +5717,70 @@ $.fn.dropdown.settings = { |
|
|
|
verbose : false, |
|
|
|
performance : true, |
|
|
|
|
|
|
|
on : 'click', |
|
|
|
// what event should show menu
|
|
|
|
on : 'click', |
|
|
|
|
|
|
|
action : 'activate', |
|
|
|
// action on item selection
|
|
|
|
action : 'activate', |
|
|
|
|
|
|
|
allowTab : true, |
|
|
|
// add tabindex to element
|
|
|
|
allowTab : true, |
|
|
|
|
|
|
|
showOnFocus : true, |
|
|
|
// show menu on focus
|
|
|
|
showOnFocus : true, |
|
|
|
|
|
|
|
fullTextSearch : false, |
|
|
|
// search anywhere in value
|
|
|
|
fullTextSearch : false, |
|
|
|
|
|
|
|
placeholder : 'auto', |
|
|
|
// whether to convert blank <select> values to placeholder text
|
|
|
|
placeholder: 'auto', |
|
|
|
|
|
|
|
preserveHTML : true, |
|
|
|
// preserve html when selecting value
|
|
|
|
preserveHTML : true, |
|
|
|
|
|
|
|
sortSelect : false, |
|
|
|
// sort selection on init
|
|
|
|
sortSelect : false, |
|
|
|
|
|
|
|
match : 'both', |
|
|
|
// what to match against with search selection (both, text, or label)
|
|
|
|
match: 'both', |
|
|
|
|
|
|
|
// allow elements with sub-menus to be selected
|
|
|
|
allowCategorySelection : false, |
|
|
|
// allow elements with sub-menus to be selected
|
|
|
|
|
|
|
|
// delay before event
|
|
|
|
delay : { |
|
|
|
hide : 300, |
|
|
|
show : 200, |
|
|
|
search : 50, |
|
|
|
touch : 50 |
|
|
|
}, |
|
|
|
// delay before event
|
|
|
|
|
|
|
|
// force a value selection on search selection
|
|
|
|
forceSelection : true, |
|
|
|
// force a value selection on search selection
|
|
|
|
|
|
|
|
// menu transiton
|
|
|
|
transition : 'auto', |
|
|
|
// menu transiton
|
|
|
|
duration : 250, |
|
|
|
|
|
|
|
// widest glyph width in em (W is 1.0714 em) used to calculate multiselect input width
|
|
|
|
glyphWidth : 1.0714, |
|
|
|
// widest glyph width in em (W is 1.0714 em) used to calculate multiselect input width
|
|
|
|
|
|
|
|
// whether multiple select should allow user added values
|
|
|
|
allowAdditions : true, |
|
|
|
// whether multiple select should allow user added values
|
|
|
|
|
|
|
|
// multi select delimiting key
|
|
|
|
delimiter : ',', |
|
|
|
// multi select delimiting key
|
|
|
|
|
|
|
|
// label settings on multi-select
|
|
|
|
label: { |
|
|
|
// label settings on multi-select
|
|
|
|
transition : 'horizontal flip', |
|
|
|
duration : 150, |
|
|
|
variation : false |
|
|
|
}, |
|
|
|
|
|
|
|
hideSelections : true, |
|
|
|
// whether multiple selects should filter active selections from menu
|
|
|
|
filterActive : true, |
|
|
|
|
|
|
|
|
|
|
|
/* Callbacks */ |
|
|
|
onLabelSelect : function($selectedLabels){}, |
|
|
@ -10217,13 +10218,13 @@ $.fn.search = function(parameters) { |
|
|
|
: [settings.searchFields], |
|
|
|
|
|
|
|
// avoid duplicates when pushing results
|
|
|
|
addResult = function(array, value) { |
|
|
|
addResult = function(array, content) { |
|
|
|
var |
|
|
|
notResult = ($.inArray(content, results) == -1), |
|
|
|
notFuzzyResult = ($.inArray(content, fuzzyResults) == -1) |
|
|
|
; |
|
|
|
if(notResult && notFuzzyResult) { |
|
|
|
array.push(value); |
|
|
|
array.push(content); |
|
|
|
} |
|
|
|
} |
|
|
|
; |
|
|
|