]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes no hover problem on dropdown menu... I'm gonna rewrite this thing
authorzurbchris <chris@zurb.com>
Sat, 21 Nov 2015 01:24:21 +0000 (17:24 -0800)
committerzurbchris <chris@zurb.com>
Sat, 21 Nov 2015 01:24:21 +0000 (17:24 -0800)
js/foundation.dropdownMenu.js

index ff412914d88e35063f333767e43ef813d8f4984d..3c1963e3db67ced4347acc5ca85fc5461bb3bb3a 100644 (file)
 
     if(!this.options.disableHover){
       //add ability for all menu items to close an open menu on the same level//
-      this.$menuItems.off('mouseenter.zf.dropdownmenu')
-          .on('mouseenter.zf.dropdownmenu', function(e){
-            var $el = $(this);
-            if(!$el.hasClass('is-active')){
-              _this._hideOthers($el);
-            }
-          });
-      //elements with submenus
-      $elem.on('mouseenter.zf.dropdownmenu', function(e){
-        clearTimeout($elem.closeTimer);
-        if(!$elem.hasClass('is-active')){
-          $elem.openTimer = setTimeout(function(){
-              // _this._hideOthers($elem);
-              _this._show($elem);
-          }, _this.options.hoverDelay);
+      this.$menuItems.on('mouseenter.zf.dropdownmenu', function(e){
+        var $el = $(this);
+        if(!$el.hasClass('is-active')){
+          _this._hideOthers($el);
         }
+      });
+      //elements with submenus
+      $elem.off('mouseenter.zf.dropdownmenu')
+        .on('mouseenter.zf.dropdownmenu', function(e){
+          clearTimeout($elem.closeTimer);
+          if(!$elem.hasClass('is-active')){
+            $elem.openTimer = setTimeout(function(){
+                // _this._hideOthers($elem);
+                _this._show($elem);
+            }, _this.options.hoverDelay);
+          }
       }).on('mouseleave.zf.dropdownmenu', function(e){
         if(!$elem.data('isClick') && _this.options.autoclose){
         clearTimeout($elem.openTimer);