]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixes #5445 (more) - Limit Accordion element selection to the current Accordion. 5446/head
authorJoe Theuerkauf <joe@thook.me>
Tue, 15 Jul 2014 06:55:52 +0000 (02:55 -0400)
committerJoe Theuerkauf <joe@thook.me>
Tue, 15 Jul 2014 06:55:52 +0000 (02:55 -0400)
js/foundation/foundation.accordion.js

index e14f7c07bb972063be098c089498c8af1c129b8b..f739baee0fe6a18f06775c27e67df2204316671c 100644 (file)
       .off('.fndtn.accordion')
       .on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a', function (e) {
         var accordion = S(this).closest('[' + self.attr_name() + ']'),
-            target = S('#' + this.href.split('#')[1]),
-            siblings = S('dd > .content', accordion),
-            aunts = $('> dd', accordion),
             groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
             settings = accordion.data(self.attr_name(true) + '-init'),
-            active_content = $('> dd > .content.' + settings.active_class, accordion);
+            target = S('#' + this.href.split('#')[1]),
+            aunts = $('> dd', accordion),
+            siblings = aunts.children('.content'),
+            active_content = siblings.filter('.' + settings.active_class);
         e.preventDefault();
 
         if (accordion.attr(self.attr_name())) {