Skip to content

Commit

Permalink
#2510 Fix dropdown icon to always toggle visibility of dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jul 7, 2015
1 parent 04458b4 commit 89e0512
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,22 @@ $.fn.dropdown = function(parameters) {
$module
.on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
.on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
.on('click' + eventNamespace, selector.search, module.show)
.on('focus' + eventNamespace, selector.search, module.event.search.focus)
.on('blur' + eventNamespace, selector.search, module.event.search.blur)
.on('click' + eventNamespace, selector.text, module.event.text.focus)
;
if(module.is.multiple()) {
$module
.on('click' + eventNamespace, module.event.click)
.on('click' + eventNamespace, module.event.click)
;
}
}
else {
if(settings.on == 'click') {
$module
.on('click' + eventNamespace, selector.icon, module.event.icon.click)
.on('click' + eventNamespace, module.event.test.toggle)
;
}
Expand Down Expand Up @@ -779,7 +781,7 @@ $.fn.dropdown = function(parameters) {
$target = $(event.target)
;
// focus search
if(($target.is($module) || $target.is($icon)) && !module.is.focusedOnSearch()) {
if($target.is($module) && !module.is.focusedOnSearch()) {
module.focusSearch();
}
},
Expand Down Expand Up @@ -823,6 +825,13 @@ $.fn.dropdown = function(parameters) {
}
}
},
icon: {
click: function(event) {
console.log('icon close');
module.toggle();
event.stopPropagation();
}
},
text: {
focus: function(event) {
activated = true;
Expand Down

0 comments on commit 89e0512

Please sign in to comment.