]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix mouseenter issue with touch devices 9174/head
authorKevin Ball <kmball11@gmail.com>
Fri, 9 Sep 2016 22:16:07 +0000 (15:16 -0700)
committerKevin Ball <kmball11@gmail.com>
Fri, 9 Sep 2016 22:16:07 +0000 (15:16 -0700)
js/foundation.dropdown.js

index 280b7be364fa3a049080314776b362b212876745..ec89f3b2ed87bf8c485f8170af83bc1c9e8476a5 100644 (file)
@@ -169,12 +169,14 @@ class Dropdown {
 
     if(this.options.hover){
       this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
-          .on('mouseenter.zf.dropdown', function(){
-            clearTimeout(_this.timeout);
-            _this.timeout = setTimeout(function(){
-              _this.open();
-              _this.$anchor.data('hover', true);
-            }, _this.options.hoverDelay);
+      .on('mouseenter.zf.dropdown', function(){
+            if($('body[data-whatinput="mouse"]').is('*')) {
+              clearTimeout(_this.timeout);
+              _this.timeout = setTimeout(function(){
+                _this.open();
+                _this.$anchor.data('hover', true);
+              }, _this.options.hoverDelay);
+            }
           }).on('mouseleave.zf.dropdown', function(){
             clearTimeout(_this.timeout);
             _this.timeout = setTimeout(function(){