From 48483ce53121e09fe4fbcf9a726460ecffe34339 Mon Sep 17 00:00:00 2001 From: Aaron Arney Date: Thu, 10 Dec 2015 14:53:38 -0500 Subject: [PATCH] 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. --- js/foundation.accordion.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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), -- 2.47.2