From 28be07c9aa951b122acd815a39cf70f534194eba Mon Sep 17 00:00:00 2001 From: ValYouW Date: Thu, 20 Apr 2017 22:37:20 +0300 Subject: [PATCH 1/3] Add option to render a custom overlay on a tile when hover --- README.md | 4 ++-- examples/index.html | 7 +++++++ src/Image.js | 14 +++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0d75b3c..87cb266 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ thumbnailHeight | number | undefined | Required. Height of th tags | array | undefined | Optional. An array of objects containing tag attributes (value and title). e.g. `{value: "foo", title: "bar"}` isSelected | bool | undefined | Optional. The selected state of the image. caption | string | undefined | Optional. Image caption. -srcset | array | undefined | Optional. Array of srcsets for lightbox. - +srcset | array | undefined | Optional. Array of srcsets for lightbox. +customOverlay | element | undefined | Optional. A custom element to be rendered as tile overlay when hovering. ## Gallery Options diff --git a/examples/index.html b/examples/index.html index 1c51bde..69fbb38 100644 --- a/examples/index.html +++ b/examples/index.html @@ -134,6 +134,13 @@

undefined Optional. Array of srcsets for lightbox. + +customOverlay +element +undefined +Optional. A custom element to be rendered as tile overlay when hovering. + +

Gallery Options

diff --git a/src/Image.js b/src/Image.js index df3a84f..4901b7d 100644 --- a/src/Image.js +++ b/src/Image.js @@ -89,6 +89,15 @@ class Image extends Component { ; }); + var customOverlay = typeof this.props.item.customOverlay === 'undefined' ?