react-grid-gallery
Advanced tools
Comparing version 0.1.12 to 0.1.13
# 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 | ||
@@ -9,3 +13,2 @@ | ||
### v0.1.11 / 2016-08-21 | ||
@@ -12,0 +15,0 @@ |
@@ -24,5 +24,3 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
//import ReactDOM from 'react-dom'; | ||
var update = require('react-addons-update'); | ||
@@ -71,7 +69,3 @@ | ||
value: function componentDidUpdate() { | ||
//if (ReactDOM.findDOMNode(this).clientWidth | ||
// !== this.state.containerWidth){ | ||
// this.handleResize(); | ||
//} | ||
if (this.refs.gallery.clientWidth !== this.state.containerWidth) { | ||
if (this._gallery.clientWidth !== this.state.containerWidth) { | ||
this.handleResize(); | ||
@@ -84,4 +78,3 @@ } | ||
this.setState({ | ||
containerWidth: Math.floor(this.refs.gallery.clientWidth) | ||
//Math.floor(ReactDOM.findDOMNode(this).clientWidth) | ||
containerWidth: Math.floor(this._gallery.clientWidth) | ||
}); | ||
@@ -207,4 +200,4 @@ } | ||
}, { | ||
key: 'renderGallery', | ||
value: function renderGallery() { | ||
key: 'renderImages', | ||
value: function renderImages() { | ||
if (!this.props.images) return; | ||
@@ -241,6 +234,10 @@ if (this.state.containerWidth == 0) return; | ||
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, { | ||
@@ -247,0 +244,0 @@ images: this.props.images, |
{ | ||
"name": "react-grid-gallery", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"description": "Justified gallery component for React.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Gallery.js", |
@@ -40,3 +40,3 @@ import React, { Component, PropTypes } from 'react'; | ||
componentDidUpdate () { | ||
if (this.refs.gallery.clientWidth | ||
if (this._gallery.clientWidth | ||
!== this.state.containerWidth){ | ||
@@ -50,3 +50,3 @@ this.handleResize(); | ||
containerWidth: | ||
Math.floor(this.refs.gallery.clientWidth) | ||
Math.floor(this._gallery.clientWidth) | ||
}); | ||
@@ -172,3 +172,3 @@ } | ||
renderGallery () { | ||
renderImages () { | ||
if (!this.props.images) return; | ||
@@ -208,4 +208,4 @@ if (this.state.containerWidth == 0) return; | ||
return ( | ||
<div id="Gallery" ref="gallery"> | ||
{this.renderGallery()} | ||
<div id="Gallery" ref={(c) => this._gallery = c}> | ||
{this.renderImages()} | ||
<Lightbox | ||
@@ -212,0 +212,0 @@ images={this.props.images} |
Sorry, the diff of this file is too big to display
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
404912
3205