Skip to content

Commit

Permalink
v0.1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
benhowell committed Aug 22, 2016
1 parent 42c15bb commit 0b41bf9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# react-grid-gallery

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

`selectedImages` state set on `componentWillReceiveProps` allowing selections from outside component to trigger state update.

### 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 :)
* Replaced legacy `ref` string with `ref` callback. Fixes multiple react owner 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
* 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

Expand Down
8 changes: 2 additions & 6 deletions lib/CheckButton.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');
Expand Down Expand Up @@ -63,6 +59,7 @@ var CheckButton = function (_Component) {
style: {
visibility: this.visibility(),
background: 'none',
float: 'left',
width: '36px',
height: '36px',
border: 'none',
Expand Down Expand Up @@ -140,5 +137,4 @@ CheckButton.defaultProps = { isSelectable: true,
parentHover: false,
hover: false };

exports.default = CheckButton;
//module.exports = CheckButton;
module.exports = CheckButton;
11 changes: 10 additions & 1 deletion lib/Gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,19 @@ var Gallery = function (_Component) {
this.handleResize();
window.addEventListener('resize', this.handleResize);
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(np) {
if (this.state.selectedImages != np.selectedImages) {
this.setState({
selectedImages: np.selectedImages
});
}
}
}, {
key: 'componentWillUpdate',
value: function componentWillUpdate(np, ns) {
if (this.state.selectedImages != ns.selectedImages) {
if (np.selectedImages != ns.selectedImages) {
if (this.props.onSelectedImagesChange) this.props.onSelectedImagesChange(ns.selectedImages);
}
}
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.13",
"version": "0.1.14",
"description": "Justified gallery component for React.",
"main": "lib/Gallery.js",
"dependencies": {
Expand Down

0 comments on commit 0b41bf9

Please sign in to comment.