From: Aaron Arney Date: Thu, 10 Dec 2015 19:53:38 +0000 (-0500) Subject: Add check for optional data-accordion-item X-Git-Tag: v6.0.6~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7469%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Add check for optional data-accordion-item If no list elements are returned initially, this checks for the presence of the data-accordion-item attribute. --- diff --git a/js/foundation.accordion.js b/js/foundation.accordion.js index 56eb8d0e8..79868ec6e 100644 --- a/js/foundation.accordion.js +++ b/js/foundation.accordion.js @@ -55,7 +55,10 @@ */ Accordion.prototype._init = function() { this.$element.attr('role', 'tablist'); - this.$tabs = this.$element.children('.accordion-item'); + this.$tabs = this.$element.children('li'); + if (this.$tabs.length == 0) { + this.$tabs = this.$element.children('[data-accordion-item]'); + } this.$tabs.each(function(idx, el){ var $el = $(el),