]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes #7413 - check if target is animating then run animation for toggle
authorTvrtko <tvrtkom@gmail.com>
Sun, 6 Dec 2015 00:39:11 +0000 (01:39 +0100)
committerTvrtko <tvrtkom@gmail.com>
Sun, 6 Dec 2015 00:39:11 +0000 (01:39 +0100)
js/foundation.accordionMenu.js

index bc98969c51651c0eb1471845979ec509602acdf7..ef366c686549cd6ddb484e507a03411de8363794 100644 (file)
    */
   AccordionMenu.prototype.toggle = function($target){
     var _this = this;
-    var setHideTimeout = function() {
-      $target.data('toggleTimeout', setTimeout(function () {
-        _this.down($target);
-      }, 200));
-    };
-    if (!$target.is(':hidden')) {
-      clearTimeout($target.data('toggleTimeout'));
-      this.up($target);
+    if (!$target.is(':hidden') && !$target.is(':animated')) {
+      _this.up($target);
     }
-    else {
-      if (typeof $target.data('toggleTimeout') !== 'undefined')
-        clearTimeout($target.data('toggleTimeout'));
-      setHideTimeout();
+    else if(!$target.is(':animated')) {
+      _this.down($target);
     }
   };
   /**