Skip to content

Commit

Permalink
fix for #401, IE11 compatible JS
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardkcohen committed Sep 24, 2017
1 parent 837c7cd commit 94796a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/accordion/js/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ Simple accordion pattern example
Gerard K. Cohen, 05/20/2017
*/

Array.from(document.querySelectorAll('.Accordion')).forEach(function (accordion) {
'use strict';

Array.prototype.slice.call(document.querySelectorAll('.Accordion')).forEach(function (accordion) {

// Allow for multiple accordion sections to be expanded at the same time
var allowMultiple = accordion.hasAttribute('data-allow-multiple');
// Allow for each toggle to both open and close individually
var allowToggle = (allowMultiple) ? allowMultiple : accordion.hasAttribute('data-allow-toggle');

// Create the array of toggle elements for the accordion group
var triggers = Array.from(accordion.querySelectorAll('.Accordion-trigger'));
var panels = Array.from(accordion.querySelectorAll('.Accordion-panel'));
var triggers = Array.prototype.slice.call(accordion.querySelectorAll('.Accordion-trigger'));
var panels = Array.prototype.slice.call(accordion.querySelectorAll('.Accordion-panel'));

accordion.addEventListener('click', function (event) {
var target = event.target;
Expand Down

0 comments on commit 94796a9

Please sign in to comment.