react-photo-gallery
Advanced tools
Comparing version 4.2.12 to 4.2.13
{ | ||
"name": "react-photo-gallery", | ||
"version": "4.2.12", | ||
"version": "4.2.13", | ||
"description": "Responsive React Photo Gallery Component", | ||
@@ -28,4 +28,3 @@ "main": "lib/Gallery.js", | ||
"react-component-gulp-tasks": "^0.7.0", | ||
"react": "~15.3.0", | ||
"react-dom": "~15.3.0" | ||
"react": "~15.3.0" | ||
}, | ||
@@ -32,0 +31,0 @@ "peerDependencies": { |
# React Responsive Photo Gallery | ||
[![Join the chat at https://gitter.im/react-photo-gallery/Lobby](https://badges.gitter.im/react-photo-gallery/Lobby.svg)](https://gitter.im/react-photo-gallery/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
A responsive React photo gallery component. | ||
@@ -3,0 +5,0 @@ |
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import Lightbox from 'react-images'; | ||
@@ -19,8 +18,8 @@ | ||
componentDidMount(){ | ||
this.setState({containerWidth: Math.floor(ReactDOM.findDOMNode(this).clientWidth)}) | ||
this.setState({containerWidth: Math.floor(this._gallery.clientWidth)}) | ||
window.addEventListener('resize', this.handleResize); | ||
} | ||
componentDidUpdate(){ | ||
if (ReactDOM.findDOMNode(this).clientWidth !== this.state.containerWidth){ | ||
this.setState({containerWidth: Math.floor(ReactDOM.findDOMNode(this).clientWidth)}); | ||
if (this._gallery.clientWidth !== this.state.containerWidth){ | ||
this.setState({containerWidth: Math.floor(this._gallery.clientWidth)}); | ||
} | ||
@@ -32,3 +31,3 @@ } | ||
handleResize(e){ | ||
this.setState({containerWidth: Math.floor(ReactDOM.findDOMNode(this).clientWidth)}); | ||
this.setState({containerWidth: Math.floor(this._gallery.clientWidth)}); | ||
} | ||
@@ -115,3 +114,3 @@ openLightbox(index, event){ | ||
return( | ||
<div id="Gallery" className="clearfix"> | ||
<div id="Gallery" className="clearfix" ref={(c) => this._gallery = c}> | ||
{photoPreviewNodes} | ||
@@ -123,3 +122,3 @@ </div> | ||
return( | ||
<div id="Gallery" className="clearfix"> | ||
<div id="Gallery" className="clearfix" ref={(c) => this._gallery = c}> | ||
{photoPreviewNodes} | ||
@@ -126,0 +125,0 @@ <Lightbox |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3869338
9
97
50121