Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuka-carousel

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuka-carousel - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

40

lib/carousel.js

@@ -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,

2

package.json
{
"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;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc