Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
benhowell committed Mar 10, 2019
1 parent c6eeef0 commit 91b5d2a
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 40 deletions.
Empty file modified .github/contributing.md
100644 → 100755
Empty file.
Empty file modified .github/issue_template.md
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified CODE_OF_CONDUCT.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified examples/app.js
100644 → 100755
Empty file.
Empty file modified examples/demo1.js
100644 → 100755
Empty file.
Empty file modified examples/demo2.js
100644 → 100755
Empty file.
Empty file modified examples/demo3.js
100644 → 100755
Empty file.
Empty file modified examples/demo4.js
100644 → 100755
Empty file.
Empty file modified examples/demo5.js
100644 → 100755
Empty file.
Empty file modified examples/demo6.js
100644 → 100755
Empty file.
Empty file modified examples/different-orientations-example.js
100644 → 100755
Empty file.
Empty file modified examples/github-light.css
100644 → 100755
Empty file.
Empty file modified examples/normalise.css
100644 → 100755
Empty file.
Empty file modified examples/stylesheet.css
100644 → 100755
Empty file.
7 changes: 3 additions & 4 deletions gulpfile.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ var ghPages = require('gulp-gh-pages');

var babelify = require('babelify');
var browserify = require('browserify');
var watchify = require('watchify');
var uglify = require('gulp-uglify');
var beautify = require('gulp-beautify');

Expand All @@ -26,7 +25,7 @@ gulp.task('build-all', function() {
runSequence(
'clean-lib',
'build-lib',
'build-cljs-lib',
/*'build-cljs-lib',*/
'clean-web',
['browserify', 'copy-css', 'copy-html'],
'deploy-web');
Expand Down Expand Up @@ -70,7 +69,7 @@ gulp.task('copy-html', function () {
//uncomment watchify + on update for continuous build
gulp.task('browserify', function() {
var bundle =
//watchify(

browserify(['./examples/app.js',
'./examples/demo1.js',
'./examples/demo2.js',
Expand All @@ -80,7 +79,7 @@ gulp.task('browserify', function() {
'./examples/demo6.js'], {
extensions: ['.js', '.jsx']
})
//)

;
bundle.transform(babelify, {'presets': ['es2015', 'react']});

Expand Down
2 changes: 1 addition & 1 deletion lib/CheckButton.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var CheckButton = function (_Component) {
function CheckButton(props) {
_classCallCheck(this, CheckButton);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CheckButton).call(this, props));
var _this = _possibleConstructorReturn(this, (CheckButton.__proto__ || Object.getPrototypeOf(CheckButton)).call(this, props));

_this.state = {
hover: _this.props.hover
Expand Down
13 changes: 9 additions & 4 deletions lib/Gallery.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var Gallery = function (_Component) {
function Gallery(props) {
_classCallCheck(this, Gallery);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Gallery).call(this, props));
var _this = _possibleConstructorReturn(this, (Gallery.__proto__ || Object.getPrototypeOf(Gallery)).call(this, props));

_this.state = {
images: _this.props.images,
Expand Down Expand Up @@ -61,6 +61,9 @@ var Gallery = function (_Component) {
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(np) {
if (this.state.currentImage > np.images.length - 1) {
this.setState({ currentImage: np.images.length - 1 });
}
if (this.state.images != np.images || this.props.maxRows != np.maxRows) {
this.setState({
images: np.images,
Expand Down Expand Up @@ -252,7 +255,7 @@ var Gallery = function (_Component) {
}, {
key: 'renderThumbs',
value: function renderThumbs(containerWidth) {
var images = arguments.length <= 1 || arguments[1] === undefined ? this.state.images : arguments[1];
var images = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state.images;

if (!images) return [];
if (containerWidth == 0) return [];
Expand Down Expand Up @@ -299,7 +302,8 @@ var Gallery = function (_Component) {
onSelectImage: _this2.onSelectImage,
tagStyle: _this2.props.tagStyle,
tileViewportStyle: _this2.props.tileViewportStyle,
thumbnailStyle: _this2.props.thumbnailStyle
thumbnailStyle: _this2.props.thumbnailStyle,
thumbnailImageComponent: _this2.props.thumbnailImageComponent
});
});
var resizeIframeStyles = {
Expand Down Expand Up @@ -399,7 +403,8 @@ Gallery.propTypes = {
thumbnailStyle: _propTypes2.default.func,
showLightboxThumbnails: _propTypes2.default.bool,
onClickLightboxThumbnail: _propTypes2.default.func,
tagStyle: _propTypes2.default.object
tagStyle: _propTypes2.default.object,
thumbnailImageComponent: _propTypes2.default.func
};

Gallery.defaultProps = {
Expand Down
38 changes: 23 additions & 15 deletions lib/Image.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

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 _propTypes = require('prop-types');
Expand Down Expand Up @@ -32,7 +34,7 @@ var Image = function (_Component) {
function Image(props) {
_classCallCheck(this, Image);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Image).call(this, props));
var _this = _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).call(this, props));

_this.state = {
hover: false
Expand Down Expand Up @@ -184,7 +186,7 @@ var Image = function (_Component) {

var customOverlay = typeof this.props.item.customOverlay === 'undefined' ? _react2.default.createElement('noscript', null) : _react2.default.createElement(
'div',
{ className: 'custom-overlay',
{ className: 'ReactGridGallery_custom-overlay',
key: "custom-overlay-" + this.props.index,
style: {
pointerEvents: "none",
Expand All @@ -195,9 +197,19 @@ var Image = function (_Component) {
this.props.item.customOverlay
);

var thumbnailProps = {
key: "img-" + this.props.index,
src: this.props.item.thumbnail,
alt: alt,
title: this.props.item.caption,
style: this.thumbnailStyle()
};

var ThumbnailImageComponent = this.props.thumbnailImageComponent;

return _react2.default.createElement(
'div',
{ className: 'tile',
{ className: 'ReactGridGallery_tile',
key: "tile-" + this.props.index,
onMouseEnter: function onMouseEnter(e) {
return _this2.setState({ hover: true });
Expand All @@ -214,7 +226,7 @@ var Image = function (_Component) {
padding: "0px" } },
_react2.default.createElement(
'div',
{ className: 'tile-icon-bar',
{ className: 'ReactGridGallery_tile-icon-bar',
key: "tile-icon-bar-" + this.props.index,
style: {
pointerEvents: "none",
Expand All @@ -226,7 +238,7 @@ var Image = function (_Component) {
),
_react2.default.createElement(
'div',
{ className: 'tile-bottom-bar',
{ className: 'ReactGridGallery_tile-bottom-bar',
key: "tile-bottom-bar-" + this.props.index,
style: {
padding: "2px",
Expand All @@ -241,7 +253,7 @@ var Image = function (_Component) {
tags
),
customOverlay,
_react2.default.createElement('div', { className: 'tile-overlay',
_react2.default.createElement('div', { className: 'ReactGridGallery_tile-overlay',
key: "tile-overlay-" + this.props.index,
style: {
pointerEvents: "none",
Expand All @@ -252,22 +264,17 @@ var Image = function (_Component) {
background: this.state.hover && !this.props.item.isSelected && this.props.isSelectable ? 'linear-gradient(to bottom,rgba(0,0,0,0.26),transparent 56px,transparent)' : 'none' } }),
_react2.default.createElement(
'div',
{ className: 'tile-viewport',
{ className: 'ReactGridGallery_tile-viewport',
style: this.tileViewportStyle(),
key: "tile-viewport-" + this.props.index,
onClick: this.props.onClick ? function (e) {
return _this2.props.onClick.call(_this2, _this2.props.index, e);
} : null },
_react2.default.createElement('img', {
key: "img-" + this.props.index,
src: this.props.item.thumbnail,
alt: alt,
title: this.props.item.caption,
style: this.thumbnailStyle() })
ThumbnailImageComponent ? _react2.default.createElement(ThumbnailImageComponent, _extends({}, this.props, { imageProps: thumbnailProps })) : _react2.default.createElement('img', thumbnailProps)
),
this.props.item.thumbnailCaption && _react2.default.createElement(
'div',
{ className: 'tile-description',
{ className: 'ReactGridGallery_tile-description',
style: {
background: "white",
height: "100%",
Expand Down Expand Up @@ -298,7 +305,8 @@ Image.propTypes = {
tileViewportStyle: _propTypes2.default.func,
thumbnailStyle: _propTypes2.default.func,
tagStyle: _propTypes2.default.object,
customOverlay: _propTypes2.default.element
customOverlay: _propTypes2.default.element,
thumbnailImageComponent: _propTypes2.default.func
};

Image.defaultProps = {
Expand Down
9 changes: 0 additions & 9 deletions lib/react-grid-gallery.bundle.min.js

This file was deleted.

Empty file modified package.json
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions src/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class Image extends Component {

var customOverlay = (typeof this.props.item.customOverlay === 'undefined')
? <noscript/> :
<div className="custom-overlay"
<div className="ReactGridGallery_custom-overlay"
key={"custom-overlay-"+this.props.index}
style={{
pointerEvents: "none",
Expand All @@ -172,7 +172,7 @@ class Image extends Component {
var ThumbnailImageComponent = this.props.thumbnailImageComponent;

return (
<div className="tile"
<div className="ReactGridGallery_tile"
key={"tile-"+this.props.index}
onMouseEnter={(e) => this.setState({hover: true})}
onMouseLeave={(e) => this.setState({hover: false})}
Expand All @@ -184,7 +184,7 @@ class Image extends Component {
background: "#eee",
padding: "0px"}}>

<div className="tile-icon-bar"
<div className="ReactGridGallery_tile-icon-bar"
key={"tile-icon-bar-"+this.props.index}
style={{
pointerEvents: "none",
Expand All @@ -195,7 +195,7 @@ class Image extends Component {
{this.renderCheckButton()}
</div>

<div className="tile-bottom-bar"
<div className="ReactGridGallery_tile-bottom-bar"
key={"tile-bottom-bar-"+this.props.index}
style={{
padding: "2px",
Expand All @@ -212,7 +212,7 @@ class Image extends Component {

{customOverlay}

<div className="tile-overlay"
<div className="ReactGridGallery_tile-overlay"
key={"tile-overlay-"+this.props.index}
style={{
pointerEvents: "none",
Expand All @@ -226,7 +226,7 @@ class Image extends Component {
'linear-gradient(to bottom,rgba(0,0,0,0.26),transparent 56px,transparent)' : 'none'}}>
</div>

<div className="tile-viewport"
<div className="ReactGridGallery_tile-viewport"
style={this.tileViewportStyle()}
key={"tile-viewport-"+this.props.index}
onClick={this.props.onClick ?
Expand All @@ -236,7 +236,7 @@ class Image extends Component {
<img {...thumbnailProps} />}
</div>
{this.props.item.thumbnailCaption && (
<div className="tile-description"
<div className="ReactGridGallery_tile-description"
style={{
background: "white",
height: "100%",
Expand Down

0 comments on commit 91b5d2a

Please sign in to comment.