]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
style: improve dropdown hiding event readability in dropdownMenu
authorNicolas Coden <nicolas@ncoden.fr>
Thu, 19 Jul 2018 21:14:21 +0000 (23:14 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Thu, 19 Jul 2018 22:14:29 +0000 (00:14 +0200)
js/foundation.dropdownMenu.js

index 042716fb5876e163d94c6a1c47037923d96640ac..7e5b4e160dfd397597f00956bfda1abd121b4c28 100644 (file)
@@ -156,13 +156,14 @@ class DropdownMenu extends Plugin {
           if ($elem.attr('data-is-click') === 'true' && _this.options.clickOpen) { return false; }
 
           clearTimeout($elem.data('_delay'));
-          $elem.data('_delay', setTimeout(function() {
+          $elem.data('_delay', setTimeout(function () {
+
             // Check for hovering over input dropdown options
-            if(e.relatedTarget === null && document.hasFocus && document.hasFocus()) {
-              return false;
-            }
+            if (e.relatedTarget === null && document.hasFocus && document.hasFocus()) { return false; }
             _this._hide($elem);
+
           }, _this.options.closingTime));
+
         }
       });
     }