From: Nicolas Coden Date: Sun, 4 Dec 2016 15:10:18 +0000 (+0100) Subject: Fix #9427 - Dropdown menu mouseout ignored X-Git-Tag: v6.3.0~6^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ec01029b89233e33c326736e7725ccaeba0bba8;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix #9427 - Dropdown menu mouseout ignored Fix https://github.com/zurb/foundation-sites/issues/9427 The hide delay of the visible dropdown is replaced by the delays of the lastly triggered dropdown, so the hide function is never called on the currently visible dropdown. Remember and cancel the delay inside each element. So a visible dropdown remember its hide delay even if several dropdown must be hidden. --- diff --git a/js/foundation.dropdownMenu.js b/js/foundation.dropdownMenu.js index 9661315d7..61f7cc149 100644 --- a/js/foundation.dropdownMenu.js +++ b/js/foundation.dropdownMenu.js @@ -118,8 +118,8 @@ class DropdownMenu { hasSub = $elem.hasClass(parClass); if (hasSub) { - clearTimeout(_this.delay); - _this.delay = setTimeout(function() { + clearTimeout(this.delay); + this.delay = setTimeout(function() { _this._show($elem.children('.is-dropdown-submenu')); }, _this.options.hoverDelay); } @@ -129,8 +129,8 @@ class DropdownMenu { if (hasSub && _this.options.autoclose) { if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { return false; } - clearTimeout(_this.delay); - _this.delay = setTimeout(function() { + clearTimeout(this.delay); + this.delay = setTimeout(function() { _this._hide($elem); }, _this.options.closingTime); }