Skip to content

Commit

Permalink
triggerHandler rather than trigger ensures that when the nested dropd…
Browse files Browse the repository at this point in the history
…own is shown, the parent dropdown's 'show' handlers don't unintentionally fire
  • Loading branch information
eoghanmurray committed Aug 29, 2017
1 parent 4db65fc commit 846a48d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jquery.dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if (jQuery) (function ($) {

// Trigger the show callback
jqDropdown
.trigger('show', {
.triggerHandler('show', {
jqDropdown: jqDropdown,
trigger: trigger
});
Expand Down Expand Up @@ -95,7 +95,7 @@ if (jQuery) (function ($) {
jqDropdown
.hide()
.removeData('jq-dropdown-trigger')
.trigger('hide', { jqDropdown: jqDropdown });
.triggerHandler('hide', { jqDropdown: jqDropdown });
});

if(!hideEvent.isDefaultPrevented()) {
Expand All @@ -108,7 +108,7 @@ if (jQuery) (function ($) {
jqDropdown
.hide()
.removeData('jq-dropdown-trigger')
.trigger('hide', { jqDropdown: jqDropdown });
.triggerHandler('hide', { jqDropdown: jqDropdown });
});
}
}
Expand Down

0 comments on commit 846a48d

Please sign in to comment.