From 4d764c25edfd116c13c4df3a667397a032c35d21 Mon Sep 17 00:00:00 2001 From: nesl247 Date: Fri, 3 Jan 2014 16:19:36 +0000 Subject: [PATCH] Don't close others if the new dropdown is_hover:false. This way if we move the mouse too far, the dropdown doesn't close --- js/foundation/foundation.dropdown.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/foundation/foundation.dropdown.js b/js/foundation/foundation.dropdown.js index ad23f47d3..51f6b689a 100644 --- a/js/foundation/foundation.dropdown.js +++ b/js/foundation/foundation.dropdown.js @@ -36,10 +36,6 @@ var $this = $(this); clearTimeout(self.timeout); - if($(e.target).data('dropdown')) { - self.closeall.call(self); - } - if ($this.data('dropdown')) { var dropdown = $('#' + $this.data('dropdown')), target = $this; @@ -49,6 +45,11 @@ } var settings = target.data('dropdown-init') || self.settings; + + if($(e.target).data('dropdown') && settings.is_hover) { + self.closeall.call(self); + } + if (settings.is_hover) self.open.apply(self, [dropdown, target]); }) .on('mouseleave.fndtn.dropdown', '[data-dropdown], [data-dropdown-content]', function (e) { -- 2.47.2