react-image-gallery
Advanced tools
Comparing version 0.6.7 to 0.6.8
@@ -95,2 +95,13 @@ 'use strict'; | ||
_createClass(ImageGallery, [{ | ||
key: 'componentWillReceiveProps', | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (this.props.disableArrowKeys !== nextProps.disableArrowKeys) { | ||
if (nextProps.disableArrowKeys) { | ||
window.removeEventListener('keydown', this._handleKeyDown); | ||
} else { | ||
window.addEventListener('keydown', this._handleKeyDown); | ||
} | ||
} | ||
} | ||
}, { | ||
key: 'componentDidUpdate', | ||
@@ -97,0 +108,0 @@ value: function componentDidUpdate(prevProps, prevState) { |
{ | ||
"name": "react-image-gallery", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"description": "React Carousel, React Image gallery, React Slide Show component", | ||
@@ -54,3 +54,3 @@ "main": "./build/image-gallery", | ||
"gulp-uglify": "^1.5.3", | ||
"react": "^15.2.1", | ||
"react": "^15.3.0", | ||
"react-dom": "^15.2.1", | ||
@@ -57,0 +57,0 @@ "vinyl-buffer": "^1.0.0", |
@@ -7,3 +7,3 @@ React Image Gallery | ||
![demo gif](https://github.com/xiaolin/react-image-gallery/raw/master/example/image_gallery.gif) | ||
![demo gif](https://github.com/xiaolin/react-image-gallery/raw/master/static/image_gallery.gif) | ||
@@ -10,0 +10,0 @@ React image gallery is a React component for building image gallery and carousels |
@@ -66,2 +66,12 @@ import React from 'react'; | ||
componentWillReceiveProps(nextProps) { | ||
if (this.props.disableArrowKeys !== nextProps.disableArrowKeys) { | ||
if (nextProps.disableArrowKeys) { | ||
window.removeEventListener('keydown', this._handleKeyDown); | ||
} else { | ||
window.addEventListener('keydown', this._handleKeyDown); | ||
} | ||
} | ||
} | ||
componentDidUpdate(prevProps, prevState) { | ||
@@ -68,0 +78,0 @@ if (prevState.galleryWidth !== this.state.galleryWidth || |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
265197
2335