react-responsive-carousel
Advanced tools
Comparing version 3.1.5 to 3.1.6
@@ -5,4 +5,2 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var React = require('react'); | ||
@@ -373,24 +371,16 @@ var ReactDOM = require('react-dom'); | ||
if (this.state.hasMount && this['item' + position].getElementsByTagName('img').length > 0) { | ||
var _ret = function () { | ||
var image = _this5['item' + position].getElementsByTagName('img')[0]; | ||
var image = this['item' + position].getElementsByTagName('img')[0]; | ||
if (!image.complete) { | ||
(function () { | ||
// if the image is still loading, the size won't be available so we trigger a new render after it's done | ||
var onImageLoad = function onImageLoad() { | ||
_this5.forceUpdate(); | ||
image.removeEventListener('load', onImageLoad); | ||
}; | ||
if (!image.complete) { | ||
// if the image is still loading, the size won't be available so we trigger a new render after it's done | ||
var onImageLoad = function onImageLoad() { | ||
_this5.forceUpdate(); | ||
image.removeEventListener('load', onImageLoad); | ||
}; | ||
image.addEventListener('load', onImageLoad); | ||
})(); | ||
} | ||
image.addEventListener('load', onImageLoad); | ||
} | ||
var height = _this5['item' + position].getElementsByTagName('img')[0].clientHeight; | ||
return { | ||
v: height > 0 ? height : null | ||
}; | ||
}(); | ||
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; | ||
var height = this['item' + position].getElementsByTagName('img')[0].clientHeight; | ||
return height > 0 ? height : null; | ||
} | ||
@@ -414,5 +404,5 @@ | ||
// show left arrow? | ||
var hasPrev = canShowArrows && this.state.selectedItem > 0 || this.props.infiniteLoop; | ||
var hasPrev = canShowArrows && (this.state.selectedItem > 0 || this.props.infiniteLoop); | ||
// show right arrow | ||
var hasNext = canShowArrows && this.state.selectedItem < itemsLength - 1 || this.props.infiniteLoop; | ||
var hasNext = canShowArrows && (this.state.selectedItem < itemsLength - 1 || this.props.infiniteLoop); | ||
// obj to hold the transformations and styles | ||
@@ -419,0 +409,0 @@ var itemListStyles = {}; |
{ | ||
"name": "react-responsive-carousel", | ||
"version": "3.1.5", | ||
"version": "3.1.6", | ||
"description": "React Responsive Carousel", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -50,2 +50,12 @@ import React from 'react'; | ||
)) | ||
.add('no arrows + infinite loop + auto play', () => ( | ||
<Carousel showArrows={false} infiniteLoop autoPlay> | ||
{ baseChildren.props.children } | ||
</Carousel> | ||
)) | ||
.add('no arrows + infinite loop + emulateTouch', () => ( | ||
<Carousel showArrows={false} infiniteLoop emulateTouch> | ||
{ baseChildren.props.children } | ||
</Carousel> | ||
)) | ||
.add('no status', () => ( | ||
@@ -52,0 +62,0 @@ <Carousel showStatus={false}> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1172124
40
1370