Skip to content

Commit

Permalink
v0.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
benhowell committed Aug 22, 2016
1 parent a16fe43 commit b758563
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# react-grid-gallery

### v0.1.13 / 2016-08-22

* Replaced legacy ref string with ref callback. Fixes unsupported stringy ref issue when using [react-grid-gallery](https://github.com/benhowell/react-grid-gallery) inside a [reagent](https://github.com/reagent-project/reagent) project :)

### v0.1.12 / 2016-08-22

* Replaced ReactDOM.findDOMNode(this) with ref, removed react-dom deps
* Added conditional to ensure image onClick not fired when no function specified
* Moved CheckButton styling (color, hoverColor, selectedColor) to props


### v0.1.11 / 2016-08-21

* Fixed react-dom typo
Expand Down
16 changes: 10 additions & 6 deletions lib/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ var Gallery = function (_Component) {
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
if (this.refs.gallery.clientWidth !== this.state.containerWidth) {
if (this._gallery.clientWidth !== this.state.containerWidth) {
this.handleResize();
}
}
}, {
key: 'handleResize',
value: function handleResize() {
this.setState({
containerWidth: Math.floor(this.refs.gallery.clientWidth)
containerWidth: Math.floor(this._gallery.clientWidth)
});
}
}, {
Expand Down Expand Up @@ -194,8 +194,8 @@ var Gallery = function (_Component) {
return items;
}
}, {
key: 'renderGallery',
value: function renderGallery() {
key: 'renderImages',
value: function renderImages() {
if (!this.props.images) return;
if (this.state.containerWidth == 0) return;
var items = this.scaleThumbs(this.props.images.slice());
Expand Down Expand Up @@ -227,10 +227,14 @@ var Gallery = function (_Component) {
}, {
key: 'render',
value: function render() {
var _this2 = this;

return _react2.default.createElement(
'div',
{ id: 'Gallery', ref: 'gallery' },
this.renderGallery(),
{ id: 'Gallery', ref: function ref(c) {
return _this2._gallery = c;
} },
this.renderImages(),
_react2.default.createElement(_reactImages2.default, {
images: this.props.images,
backdropClosesModal: this.props.backdropClosesModal,
Expand Down
16 changes: 8 additions & 8 deletions lib/react-grid-gallery.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-grid-gallery",
"version": "0.1.12",
"version": "0.1.13",
"description": "Justified gallery component for React.",
"main": "lib/Gallery.js",
"dependencies": {
Expand Down

0 comments on commit b758563

Please sign in to comment.