From: Kevin Ball Date: Fri, 9 Sep 2016 22:16:07 +0000 (-0700) Subject: Fix mouseenter issue with touch devices X-Git-Tag: v6.2.4-rc1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9174%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix mouseenter issue with touch devices --- diff --git a/js/foundation.dropdown.js b/js/foundation.dropdown.js index 280b7be36..ec89f3b2e 100644 --- a/js/foundation.dropdown.js +++ b/js/foundation.dropdown.js @@ -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(){