|
@ -1296,7 +1296,7 @@ $.fn.dropdown = function(parameters) { |
|
|
hasSelectedItem = ($selectedItem.length > 0), |
|
|
hasSelectedItem = ($selectedItem.length > 0), |
|
|
selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0), |
|
|
selectedIsSelectable = ($selectedItem.not(selector.unselectable).length > 0), |
|
|
delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()), |
|
|
delimiterPressed = (pressedKey == keys.delimiter && settings.allowAdditions && module.is.multiple()), |
|
|
isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed) && selectedIsSelectable), |
|
|
|
|
|
|
|
|
isAdditionWithoutMenu = (settings.allowAdditions && settings.hideAdditions && (pressedKey == keys.enter || delimiterPressed)), |
|
|
$nextItem, |
|
|
$nextItem, |
|
|
isSubMenuItem, |
|
|
isSubMenuItem, |
|
|
newIndex |
|
|
newIndex |
|
@ -1304,6 +1304,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
|
|
|
|
|
// allow selection with menu closed
|
|
|
// allow selection with menu closed
|
|
|
if(isAdditionWithoutMenu) { |
|
|
if(isAdditionWithoutMenu) { |
|
|
|
|
|
$selectedItem = $menu.children(selector.addition); |
|
|
module.verbose('Selecting item from keyboard shortcut', $selectedItem); |
|
|
module.verbose('Selecting item from keyboard shortcut', $selectedItem); |
|
|
module.event.item.click.call($selectedItem, event); |
|
|
module.event.item.click.call($selectedItem, event); |
|
|
if(module.is.searchSelection()) { |
|
|
if(module.is.searchSelection()) { |
|
@ -2570,6 +2571,7 @@ $.fn.dropdown = function(parameters) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(value === '' || alreadyHasValue) { |
|
|
if(value === '' || alreadyHasValue) { |
|
|
|
|
|
console.log('removing addition'); |
|
|
$addition.remove(); |
|
|
$addition.remove(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -2594,6 +2596,7 @@ $.fn.dropdown = function(parameters) { |
|
|
$addition |
|
|
$addition |
|
|
.prependTo($menu) |
|
|
.prependTo($menu) |
|
|
; |
|
|
; |
|
|
|
|
|
$item.add($addition); |
|
|
module.verbose('Adding item choice to menu corresponding with user choice addition', $addition); |
|
|
module.verbose('Adding item choice to menu corresponding with user choice addition', $addition); |
|
|
} |
|
|
} |
|
|
if(!settings.hideAdditions || module.is.allFiltered()) { |
|
|
if(!settings.hideAdditions || module.is.allFiltered()) { |
|
|