react-grid-gallery
Advanced tools
Comparing version 0.3.1 to 0.3.2
# react-grid-gallery | ||
### v0.3.2 / 2017-04-07 | ||
* Added `maxRows` functionality [issue #21](https://github.com/benhowell/react-grid-gallery/issues/21). | ||
### v0.3.1 / 2017-04-04 | ||
* Added lightboxWillOpen and lightBoxWillClose functionality [PR 20](https://github.com/benhowell/react-grid-gallery/pull/20). Thanks [ValYouW](https://github.com/ValYouW). | ||
* Added `lightboxWillOpen` and `lightBoxWillClose` functionality [PR 20](https://github.com/benhowell/react-grid-gallery/pull/20). Thanks [ValYouW](https://github.com/ValYouW). | ||
@@ -7,0 +12,0 @@ * Updated documentation for onClickThumbnail fn [issue #19](https://github.com/benhowell/react-grid-gallery/issues/19) |
@@ -239,3 +239,9 @@ 'use strict'; | ||
var item = rows[r][i]; | ||
thumbs.push(item); | ||
if (this.props.maxRows) { | ||
if (r < this.props.maxRows) { | ||
thumbs.push(item); | ||
} | ||
} else { | ||
thumbs.push(item); | ||
} | ||
} | ||
@@ -313,2 +319,3 @@ } | ||
rowHeight: _react.PropTypes.number, | ||
maxRows: _react.PropTypes.number, | ||
margin: _react.PropTypes.number, | ||
@@ -315,0 +322,0 @@ onClickThumbnail: _react.PropTypes.func, |
{ | ||
"name": "react-grid-gallery", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Justified gallery component for React.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Gallery.js", |
@@ -80,2 +80,3 @@ # React Grid Gallery | ||
rowHeight | number | 180 | Optional. The height of each row in the gallery. | ||
maxRows | number | undefined | Optional. The maximum number of rows to show in the gallery. | ||
margin | number | 2 | Optional. The margin around each image in the gallery. | ||
@@ -82,0 +83,0 @@ enableLightbox | bool | true | Optional. Enable lightbox display of full size image when thumbnail clicked. |
@@ -205,3 +205,10 @@ import React, { Component, PropTypes } from 'react'; | ||
var item = rows[r][i]; | ||
thumbs.push(item); | ||
if(this.props.maxRows) { | ||
if(r < this.props.maxRows) { | ||
thumbs.push(item); | ||
} | ||
} | ||
else { | ||
thumbs.push(item); | ||
} | ||
} | ||
@@ -272,2 +279,3 @@ } | ||
rowHeight: PropTypes.number, | ||
maxRows: PropTypes.number, | ||
margin: PropTypes.number, | ||
@@ -274,0 +282,0 @@ onClickThumbnail: PropTypes.func, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
448191
3454
151