From: Kevin Ball Date: Wed, 9 Nov 2016 23:40:04 +0000 (-0800) Subject: Remove accidental whatinput requirement introduced in #9174 X-Git-Tag: v6.3-rc1~6^2~7^2~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d362138695e28bd7a2b8141cedeb6935d0508f05;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Remove accidental whatinput requirement introduced in #9174 --- diff --git a/js/foundation.dropdown.js b/js/foundation.dropdown.js index 6a40eec3c..1b3cefc66 100644 --- a/js/foundation.dropdown.js +++ b/js/foundation.dropdown.js @@ -170,20 +170,21 @@ class Dropdown { if(this.options.hover){ this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown') .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(){ - _this.close(); - _this.$anchor.data('hover', false); - }, _this.options.hoverDelay); - }); + var bodyData = $('body').data(); + if(typeof(bodyData.whatinput) === 'undefined' || bodyData.whatinput === 'mouse') { + 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(){ + _this.close(); + _this.$anchor.data('hover', false); + }, _this.options.hoverDelay); + }); if(this.options.hoverPane){ this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown') .on('mouseenter.zf.dropdown', function(){