Permalink
Browse files

Removed the references to a specific HTML element, and instead used t…

…he class associated with that element in the examples
  • Loading branch information...
Joel Kinzel
Joel Kinzel committed Oct 1, 2014
1 parent f09d580 commit 18cef991f9a50acf2c78652b4a2641b80889d2b0
Showing with 5 additions and 5 deletions.
  1. +5 −5 js/foundation/foundation.accordion.js
@@ -22,23 +22,23 @@
var S = this.S;
S(this.scope)
.off('.fndtn.accordion')
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > dd > a', function (e) {
.on('click.fndtn.accordion', '[' + this.attr_name() + '] > .accordion-navigation > a', function (e) {
var accordion = S(this).closest('[' + self.attr_name() + ']'),
groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()),
settings = accordion.data(self.attr_name(true) + '-init'),
target = S('#' + this.href.split('#')[1]),
aunts = $('> dd', accordion),
aunts = $('> .accordion-navigation', accordion),
siblings = aunts.children('.content'),
active_content = siblings.filter('.' + settings.active_class);
e.preventDefault();
if (accordion.attr(self.attr_name())) {
siblings = siblings.add('[' + groupSelector + '] dd > .content');
aunts = aunts.add('[' + groupSelector + '] dd');
siblings = siblings.add('[' + groupSelector + '] .accordion-navigation > .content');
aunts = aunts.add('[' + groupSelector + '] .accordion-navigation');
}
if (settings.toggleable && target.is(active_content)) {
target.parent('dd').toggleClass(settings.active_class, false);
target.parent('.accordion-navigation').toggleClass(settings.active_class, false);
target.toggleClass(settings.active_class, false);
settings.callback(target);
target.triggerHandler('toggled', [accordion]);

0 comments on commit 18cef99

Please sign in to comment.