Skip to content

Commit

Permalink
Work around IE8 error.
Browse files Browse the repository at this point in the history
It chokes when using `foo.type = 'button'`, so use `setAttribute`.
  • Loading branch information
XhmikosR committed Apr 10, 2016
1 parent b9dc118 commit b48f8c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/baguetteBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,26 @@
overlay.appendChild(slider);
// Create all necessary buttons
previousButton = create('button');
previousButton.setAttribute('type', 'button');
previousButton.id = 'previous-button';
previousButton.setAttribute('aria-label', 'Previous');
previousButton.innerHTML = supports.svg ? leftArrow : '<';
overlay.appendChild(previousButton);

nextButton = create('button');
nextButton.setAttribute('type', 'button');
nextButton.id = 'next-button';
nextButton.setAttribute('aria-label', 'Next');
nextButton.innerHTML = supports.svg ? rightArrow : '>';
overlay.appendChild(nextButton);

closeButton = create('button');
closeButton.setAttribute('type', 'button');
closeButton.id = 'close-button';
closeButton.setAttribute('aria-label', 'Close');
closeButton.innerHTML = supports.svg ? closeX : '&times';
overlay.appendChild(closeButton);

previousButton.type = nextButton.type = closeButton.type = 'button';
previousButton.className = nextButton.className = closeButton.className = 'baguetteBox-button';

bindEvents();
Expand Down

0 comments on commit b48f8c2

Please sign in to comment.