Skip to content

Commit

Permalink
fixed IE incompatibility with forEach
Browse files Browse the repository at this point in the history
fixes: #1138
fixes: #1151
  • Loading branch information
laveesingh committed Mar 29, 2018
1 parent 0b9f477 commit 05d458d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/inner-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class InnerSlider extends React.Component {
}
})
this.ro.observe(this.list)
Array.from(document.querySelectorAll('.slick-slide')).forEach( slide => {
Array.prototype.forEach.call(document.querySelectorAll('.slick-slide'), slide => {
slide.onfocus = this.props.pauseOnFocus ? this.onSlideFocus : null
slide.onblur = this.props.pauseOnFocus ? this.onSlideBlur : null
})
Expand Down Expand Up @@ -218,7 +218,7 @@ export class InnerSlider extends React.Component {
let images = document.querySelectorAll('.slick-slide img')
let imagesCount = images.length,
loadedCount = 0
Array.from(images).forEach(image => {
Array.prototype.forEach.call(images, image => {
const handler = () => ++loadedCount &&
(loadedCount >= imagesCount) && this.onWindowResized()
if (!image.onclick) {
Expand Down

0 comments on commit 05d458d

Please sign in to comment.