From: nesl247 Date: Fri, 3 Jan 2014 16:19:36 +0000 (+0000) Subject: Don't close others if the new dropdown is_hover:false. This way if we move the mouse... X-Git-Tag: 5.0.3~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4001%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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 --- 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) {