Merge pull request #151 from mewtaylor/bugfix/make-arrows-appear

separate out arrows var from settings object
This commit is contained in:
Matthew Taylor 2015-10-23 15:15:27 -04:00
commit f4d0fba079

View file

@ -23,7 +23,6 @@ var Carousel = React.createClass({
render: function () {
var settings = this.props.settings || {};
defaults(settings, {
arrows: this.props.items.length > settings.slidesToShow,
dots: false,
infinite: false,
lazyLoad: true,
@ -31,9 +30,10 @@ var Carousel = React.createClass({
slidesToScroll: 5,
variableWidth: true
});
var arrows = this.props.items.length > settings.slidesToShow;
return (
<Slider className={'carousel ' + this.props.className} {... settings}>
<Slider className={'carousel ' + this.props.className} arrows={arrows} {... settings}>
{this.props.items.map(function (item) {
var href = '';
switch (item.type) {