Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ttamminen committed Apr 21, 2017
1 parent e9213bc commit a68b110
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/components/Thumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ module.exports = React.createClass({
window.removeEventListener("DOMContentLoaded", this.updateStatics);
},
componentDidMount: function componentDidMount(nextProps) {
var that = this;
// as the widths are calculated, we need to resize
// the carousel when the window is resized
window.addEventListener("resize", this.updateStatics);
// issue #2 - image loading smaller
window.addEventListener("DOMContentLoaded", this.updateStatics);

var defaultImg = ReactDOM.findDOMNode(this.thumb0).getElementsByTagName('img')[0];
defaultImg.addEventListener('load', this.setMountState);
defaultImg.addEventListener('load', function () {
that.setMountState();
that.updateStatics();
});

// when the component is rendered we need to calculate
// the container size to adjust the responsive behaviour
Expand Down Expand Up @@ -249,4 +253,4 @@ module.exports = React.createClass({
)
);
}
});
});

0 comments on commit a68b110

Please sign in to comment.