Skip to content

Commit

Permalink
+ PR77 #77 add contentWindow check
Browse files Browse the repository at this point in the history
  • Loading branch information
benhowell committed Apr 29, 2018
1 parent ffb548e commit 4b51590
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,11 @@ class Gallery extends Component {
width: "100%"
};
return (
<div id={this.props.id} className="ReactGridGallery" ref={(c) => this._gallery = c}>
<iframe style={resizeIframeStyles} ref={(c) => c && c.contentWindow && c.contentWindow.addEventListener('resize', this.onResize) } />
<div id={this.props.id}
className="ReactGridGallery"
ref={(c) => this._gallery = c}>
<iframe style={resizeIframeStyles}
ref={(c) => c && c.contentWindow && c.contentWindow.addEventListener('resize', this.onResize) } />
{images}
<Lightbox
images={this.props.images}
Expand Down

0 comments on commit 4b51590

Please sign in to comment.