Skip to content

Commit

Permalink
fixes #7413 - check if target is animating then run animation for toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Tvrtko committed Dec 6, 2015
1 parent d0337c8 commit a5ee973
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions js/foundation.accordionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,11 @@
*/
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);
}
};
/**
Expand Down

0 comments on commit a5ee973

Please sign in to comment.