Skip to content

Commit

Permalink
[fixes #613] Don't prevent the event from bubbling up the DOM tree wh…
Browse files Browse the repository at this point in the history
…en clicked on any descendant of the dropdown element
  • Loading branch information
trimentor committed Aug 3, 2012
1 parent 99d6961 commit f5ab92c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
$('.button.dropdown > ul', this).addClass('no-hover');

$('.button.dropdown', this).on('click.fndtn', function (e) {
e.stopPropagation();
// Stops further propagation of the event up the DOM tree when clicked on the button.
// Events fired by its descendants are not being blocked.
if (e.target === this) {
e.stopPropagation();
}
});
$('.button.dropdown.split span', this).on('click.fndtn', function (e) {
e.preventDefault();
Expand Down

0 comments on commit f5ab92c

Please sign in to comment.