]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Add check for optional data-accordion-item 7469/head
authorAaron Arney <ocularrhythm@users.noreply.github.com>
Thu, 10 Dec 2015 19:53:38 +0000 (14:53 -0500)
committerAaron Arney <ocularrhythm@users.noreply.github.com>
Thu, 10 Dec 2015 19:53:38 +0000 (14:53 -0500)
If no list elements are returned initially, this checks for the presence of the data-accordion-item attribute.

js/foundation.accordion.js

index 56eb8d0e8da18708c5764d0c105281a307ad4b52..79868ec6e804c375ace638a037cb7c136729eddd 100644 (file)
    */
   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),