From 587c9dcbf46b5c6dac9ca0ba5c7717e2059b95aa Mon Sep 17 00:00:00 2001 From: eoghan Date: Tue, 29 Aug 2017 15:09:42 +0000 Subject: [PATCH] triggerHandler rather than trigger ensures that when the nested dropdown is shown, the parent dropdown's 'show' handlers don't unintentionally fire --- jquery.dropdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.dropdown.js b/jquery.dropdown.js index ffccd56..73b5725 100644 --- a/jquery.dropdown.js +++ b/jquery.dropdown.js @@ -63,7 +63,7 @@ if (jQuery) (function ($) { // Trigger the show callback jqDropdown - .trigger('show', { + .triggerHandler('show', { jqDropdown: jqDropdown, trigger: trigger }); @@ -95,7 +95,7 @@ if (jQuery) (function ($) { var jqDropdown = $(this); jqDropdown .hide() - .trigger('hide', { jqDropdown: jqDropdown }); + .triggerHandler('hide', { jqDropdown: jqDropdown }); }); if(!hideEvent.isDefaultPrevented()) { @@ -108,7 +108,7 @@ if (jQuery) (function ($) { jqDropdown .hide() .removeData('jq-dropdown-trigger') - .trigger('hide', { jqDropdown: jqDropdown }); + .triggerHandler('hide', { jqDropdown: jqDropdown }); }); } }