Commit d735d38d authored by morant's avatar morant

* Fix aligning of thumbnails inside a NestedCarousel

* Remove links from thumbnail image
* Fix vertical aligning when a thumbnail has more than one line of text
parent c7cc1b62
...@@ -35,7 +35,7 @@ var NestedCarousel = React.createClass({ ...@@ -35,7 +35,7 @@ var NestedCarousel = React.createClass({
lazyLoad: true, lazyLoad: true,
slidesToShow: 1, slidesToShow: 1,
slidesToScroll: 1, slidesToScroll: 1,
variableWidth: true variableWidth: false
}); });
var arrows = this.props.items.length > settings.slidesToShow; var arrows = this.props.items.length > settings.slidesToShow;
......
...@@ -2,7 +2,19 @@ ...@@ -2,7 +2,19 @@
@import "../carousel/carousel.scss"; @import "../carousel/carousel.scss";
.nestedcarousel { .nestedcarousel {
/* Overrides carousel's settings for extra padding */
.slick-slide { .slick-slide {
padding-left: 60px; padding: 0;
/* Add some padding under the title for each slide */
h3 {
padding-bottom: 10px;
}
/* Align to top. Important when one of the slides have
more than one line of text */
.thumbnail.project {
vertical-align: top;
}
} }
} }
...@@ -55,18 +55,21 @@ var Thumbnail = React.createClass({ ...@@ -55,18 +55,21 @@ var Thumbnail = React.createClass({
</div> </div>
); );
} }
var titleElement;
var imgElement,titleElement;
if (this.props.linkTitle) { if (this.props.linkTitle) {
imgElement = <a className="thumbnail-image" href={this.props.href}>
<img src={this.props.src} />
</a>;
titleElement = <a href={this.props.href}>{this.props.title}</a>; titleElement = <a href={this.props.href}>{this.props.title}</a>;
} else { } else {
imgElement = <img src={this.props.src} />;
titleElement = this.props.title; titleElement = this.props.title;
} }
return ( return (
<div className={classes} > <div className={classes} >
<a className="thumbnail-image" href={this.props.href}> {imgElement}
<img src={this.props.src} />
</a>
<div className="thumbnail-title"> <div className="thumbnail-title">
{titleElement} {titleElement}
</div> </div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment