]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
#7413 - refactor toggle 7418/head
authorTvrtko <tvrtkom@gmail.com>
Mon, 7 Dec 2015 22:18:10 +0000 (23:18 +0100)
committerTvrtko <tvrtkom@gmail.com>
Mon, 7 Dec 2015 22:18:10 +0000 (23:18 +0100)
js/foundation.accordionMenu.js

index ef366c686549cd6ddb484e507a03411de8363794..bea5eb4c0db25c17d30dd609fe5170fd344d93cb 100644 (file)
    * @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);
+      }
     }
   };
   /**