mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
separate out arrows var from settings object
seems to be returning false when it shouldn't. When I was testing before it appears I was getting a cached js, so it didn't actually work.
This commit is contained in:
parent
9e9dc0221d
commit
c6095d6425
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,6 @@ var Carousel = React.createClass({
|
||||||
render: function () {
|
render: function () {
|
||||||
var settings = this.props.settings || {};
|
var settings = this.props.settings || {};
|
||||||
defaults(settings, {
|
defaults(settings, {
|
||||||
arrows: this.props.items.length > settings.slidesToShow,
|
|
||||||
dots: false,
|
dots: false,
|
||||||
infinite: false,
|
infinite: false,
|
||||||
lazyLoad: true,
|
lazyLoad: true,
|
||||||
|
@ -31,9 +30,10 @@ var Carousel = React.createClass({
|
||||||
slidesToScroll: 5,
|
slidesToScroll: 5,
|
||||||
variableWidth: true
|
variableWidth: true
|
||||||
});
|
});
|
||||||
|
var arrows = this.props.items.length > settings.slidesToShow;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Slider className={'carousel ' + this.props.className} {... settings}>
|
<Slider className={'carousel ' + this.props.className} arrows={arrows} {... settings}>
|
||||||
{this.props.items.map(function (item) {
|
{this.props.items.map(function (item) {
|
||||||
var href = '';
|
var href = '';
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
|
|
Loading…
Reference in a new issue