From: Tvrtko Date: Mon, 7 Dec 2015 22:18:10 +0000 (+0100) Subject: #7413 - refactor toggle X-Git-Tag: v6.0.6~57^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7418%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git #7413 - refactor toggle --- diff --git a/js/foundation.accordionMenu.js b/js/foundation.accordionMenu.js index ef366c686..bea5eb4c0 100644 --- a/js/foundation.accordionMenu.js +++ b/js/foundation.accordionMenu.js @@ -187,12 +187,13 @@ * @param {jQuery} $target - the submenu to toggle */ AccordionMenu.prototype.toggle = function($target){ - var _this = this; - if (!$target.is(':hidden') && !$target.is(':animated')) { - _this.up($target); - } - else if(!$target.is(':animated')) { - _this.down($target); + if(!$target.is(':animated')) { + if (!$target.is(':hidden')) { + this.up($target); + } + else { + this.down($target); + } } }; /**