From 81f50e0f7a2aae6e68683c17558b36e6bec0ce63 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Wed, 12 Aug 2015 09:45:19 -0400 Subject: [PATCH] #2769 Fix logic in onHide, to only close when NOT false, add onShow --- src/definitions/modules/dropdown.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 166501edb..a2be4dc19 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -412,14 +412,15 @@ $.fn.dropdown = function(parameters) { if(module.has.message() && !module.has.maxSelections()) { module.remove.message(); } - module.animate.show(function() { - if( module.can.click() ) { - module.bind.intent(); - } - module.set.visible(); - callback.call(element); - }); - settings.onShow.call(element); + if(settings.onHide.call(element) !== false) { + module.animate.show(function() { + if( module.can.click() ) { + module.bind.intent(); + } + module.set.visible(); + callback.call(element); + }); + } } }, @@ -430,7 +431,7 @@ $.fn.dropdown = function(parameters) { ; if( module.is.active() ) { module.debug('Hiding dropdown'); - if(settings.onHide.call(element) === false) { + if(settings.onHide.call(element) !== false) { module.animate.hide(function() { module.remove.visible(); callback.call(element);