nuka-carousel
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -75,2 +75,3 @@ 'use strict'; | ||
framePadding: _React2['default'].PropTypes.string, | ||
initialSlideHeight: _React2['default'].PropTypes.number, | ||
slidesToShow: _React2['default'].PropTypes.number, | ||
@@ -115,2 +116,6 @@ slidesToScroll: _React2['default'].PropTypes.number, | ||
componentWillMount: function componentWillMount() { | ||
this.setInitialDimensions(); | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
@@ -464,2 +469,37 @@ this.setDimensions(); | ||
setInitialDimensions: function setInitialDimensions() { | ||
var self = this, | ||
slideWidth, | ||
frameWidth, | ||
frameHeight, | ||
slideHeight; | ||
frameWidth = this.props.width || 0; | ||
if (typeof this.props.slideWidth !== 'number') { | ||
slideWidth = parseInt(this.props.slideWidth); | ||
} else { | ||
if (this.props.vertical) { | ||
slideWidth = slideHeight / this.props.slidesToShow * this.props.slideWidth; | ||
} else { | ||
slideWidth = frameWidth / this.props.slidesToShow * this.props.slideWidth; | ||
} | ||
} | ||
if (!this.props.vertical) { | ||
slideWidth -= this.props.cellSpacing * ((100 - 100 / this.props.slidesToShow) / 100); | ||
} | ||
frameHeight = (this.props.initialSlideHeight || 0) + this.props.cellSpacing / 2 * (this.props.slidesToShow - 1); | ||
this.setState({ | ||
frameWidth: this.props.vertical ? frameHeight : frameWidth, | ||
slideCount: this.props.children.length, | ||
slideWidth: slideWidth | ||
}, function () { | ||
self.setLeft(); | ||
self.setExternalData(); | ||
}); | ||
}, | ||
setDimensions: function setDimensions() { | ||
@@ -466,0 +506,0 @@ var self = this, |
{ | ||
"name": "nuka-carousel", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Pure React Carousel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -51,2 +51,3 @@ 'use strict'; | ||
framePadding: React.PropTypes.string, | ||
initialSlideHeight: React.PropTypes.number, | ||
slidesToShow: React.PropTypes.number, | ||
@@ -94,2 +95,6 @@ slidesToScroll: React.PropTypes.number, | ||
componentWillMount() { | ||
this.setInitialDimensions(); | ||
}, | ||
componentDidMount() { | ||
@@ -447,2 +452,33 @@ this.setDimensions(); | ||
setInitialDimensions() { | ||
var self = this, slideWidth, frameWidth, frameHeight, slideHeight; | ||
frameWidth = this.props.width || 0; | ||
if (typeof this.props.slideWidth !== 'number') { | ||
slideWidth = parseInt(this.props.slideWidth); | ||
} else { | ||
if (this.props.vertical) { | ||
slideWidth = (slideHeight / this.props.slidesToShow) * this.props.slideWidth; | ||
} else { | ||
slideWidth = (frameWidth / this.props.slidesToShow) * this.props.slideWidth; | ||
} | ||
} | ||
if (!this.props.vertical) { | ||
slideWidth -= this.props.cellSpacing * ((100 - (100 / this.props.slidesToShow)) / 100); | ||
} | ||
frameHeight = (this.props.initialSlideHeight || 0) + ((this.props.cellSpacing / 2) * (this.props.slidesToShow - 1)); | ||
this.setState({ | ||
frameWidth: this.props.vertical ? frameHeight : frameWidth, | ||
slideCount: this.props.children.length, | ||
slideWidth: slideWidth | ||
}, function() { | ||
self.setLeft(); | ||
self.setExternalData(); | ||
}); | ||
}, | ||
setDimensions() { | ||
@@ -449,0 +485,0 @@ var self = this, slideWidth, firstSlide, frame, frameHeight, slideHeight; |
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
80251
2230