|
|
@ -191,10 +191,14 @@ $.fn.dropdown = function(parameters) { |
|
|
|
.on('keydown' + eventNamespace, module.event.keydown) |
|
|
|
; |
|
|
|
if( module.is.searchable() ) { |
|
|
|
$search |
|
|
|
.on( module.get.inputEvent(), module.event.input) |
|
|
|
; |
|
|
|
} |
|
|
|
if( module.is.searchSelection() ) { |
|
|
|
$search |
|
|
|
.on('focus' + eventNamespace, module.event.searchFocus) |
|
|
|
.on('blur' + eventNamespace, module.event.blur) |
|
|
|
.on( module.get.inputEvent(), module.event.input) |
|
|
|
; |
|
|
|
} |
|
|
|
else { |
|
|
@ -208,7 +212,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
}, |
|
|
|
touchEvents: function() { |
|
|
|
module.debug('Touch device detected binding touch events'); |
|
|
|
if( !module.is.searchable() ) { |
|
|
|
if( !module.is.searchSelection() ) { |
|
|
|
$module |
|
|
|
.on('touchstart' + eventNamespace, module.event.test.toggle) |
|
|
|
; |
|
|
@ -220,7 +224,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
}, |
|
|
|
mouseEvents: function() { |
|
|
|
module.verbose('Mouse detected binding mouse events'); |
|
|
|
if( !module.is.searchable() ) { |
|
|
|
if( !module.is.searchSelection() ) { |
|
|
|
if(settings.on == 'click') { |
|
|
|
$module |
|
|
|
.on('click' + eventNamespace, module.event.test.toggle) |
|
|
@ -280,6 +284,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
fullTextRegExp = new RegExp(searchTerm, 'i'), |
|
|
|
$filteredItems |
|
|
|
; |
|
|
|
console.log(query); |
|
|
|
$item |
|
|
|
.each(function(){ |
|
|
|
var |
|
|
@ -346,6 +351,7 @@ $.fn.dropdown = function(parameters) { |
|
|
|
var |
|
|
|
query = $search.val() |
|
|
|
; |
|
|
|
console.log($search, query); |
|
|
|
$text.addClass(className.filtered); |
|
|
|
module.filter(query); |
|
|
|
}, |
|
|
@ -902,6 +908,9 @@ $.fn.dropdown = function(parameters) { |
|
|
|
searchable: function() { |
|
|
|
return ($search.size() > 0); |
|
|
|
}, |
|
|
|
searchSelection: function() { |
|
|
|
return ( module.is.searchable() && $search.parent().is($module) ); |
|
|
|
}, |
|
|
|
selection: function() { |
|
|
|
return $module.hasClass(className.selection); |
|
|
|
}, |
|
|
@ -1322,8 +1331,8 @@ $.fn.dropdown.settings = { |
|
|
|
onHide : function(){}, |
|
|
|
|
|
|
|
error : { |
|
|
|
action : 'You called a dropdown action that was not defined', |
|
|
|
method : 'The method you called is not defined.', |
|
|
|
action : 'You called a dropdown action that was not defined', |
|
|
|
method : 'The method you called is not defined.', |
|
|
|
transition : 'The requested transition was not found' |
|
|
|
}, |
|
|
|
|
|
|
@ -1338,7 +1347,7 @@ $.fn.dropdown.settings = { |
|
|
|
dropdown : '.ui.dropdown', |
|
|
|
text : '> .text:not(.icon)', |
|
|
|
input : '> input[type="hidden"], > select', |
|
|
|
search : '> .search, .menu > .search', |
|
|
|
search : '> .search, .menu > .search > input, .menu > input.search', |
|
|
|
menu : '.menu', |
|
|
|
item : '.item' |
|
|
|
}, |
|
|
|