Fix #341 - Remove react-responsive in favour of simpler resize handler/window width
This commit is contained in:
parent
2ef9f36cf2
commit
bf5f8a2449
6 changed files with 58 additions and 45 deletions
|
@ -41,15 +41,17 @@ const Lightbox = React.createClass({
|
|||
mixins: [PureRenderMixin],
|
||||
|
||||
componentDidMount () {
|
||||
this._listener = window.addEventListener('keyup', e => {
|
||||
this._listener = e => {
|
||||
if (e.key === 'Escape') {
|
||||
this.props.onCloseClicked();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
window.addEventListener('keyup', this._listener);
|
||||
},
|
||||
|
||||
componentWillUnmount () {
|
||||
window.removeEventListener(this._listener);
|
||||
window.removeEventListener('keyup', this._listener);
|
||||
},
|
||||
|
||||
render () {
|
||||
|
|
Reference in a new issue