]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Remove accidental whatinput requirement introduced in #9174 9354/head
authorKevin Ball <kmball11@gmail.com>
Wed, 9 Nov 2016 23:40:04 +0000 (15:40 -0800)
committerKevin Ball <kmball11@gmail.com>
Wed, 9 Nov 2016 23:40:04 +0000 (15:40 -0800)
js/foundation.dropdown.js

index 6a40eec3c4db8198b0770a818afe1cd8198453d6..1b3cefc6684fe1276ed3827036cf08ef356219d5 100644 (file)
@@ -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(){