nuka-carousel
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "nuka-carousel", | ||
"main": "index.js", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"homepage": "https://github.com/kenwheeler/nuka-carousel", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -31,2 +31,15 @@ 'use strict'; | ||
var addEvent = function addEvent(elem, type, eventHandle) { | ||
if (elem == null || typeof elem === 'undefined') { | ||
return; | ||
} | ||
if (elem.addEventListener) { | ||
elem.addEventListener(type, eventHandle, false); | ||
} else if (elem.attachEvent) { | ||
elem.attachEvent('on' + type, eventHandle); | ||
} else { | ||
elem['on' + type] = eventHandle; | ||
} | ||
}; | ||
var Carousel = _React2['default'].createClass({ | ||
@@ -361,5 +374,8 @@ displayName: 'Carousel', | ||
var self = this; | ||
window.onresize = function () { | ||
addEvent(window, 'resize', function () { | ||
self.setDimensions(); | ||
}; | ||
}); | ||
addEvent(document, 'readystatechange', function () { | ||
self.setDimensions(); | ||
}); | ||
}, | ||
@@ -366,0 +382,0 @@ |
{ | ||
"name": "nuka-carousel", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Pure React Carousel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,15 @@ 'use strict'; | ||
const addEvent = function(elem, type, eventHandle) { | ||
if (elem == null || typeof (elem) === 'undefined') { | ||
return; | ||
} | ||
if (elem.addEventListener) { | ||
elem.addEventListener(type, eventHandle, false); | ||
} else if (elem.attachEvent) { | ||
elem.attachEvent('on' + type, eventHandle); | ||
} else { | ||
elem['on'+type] = eventHandle; | ||
} | ||
}; | ||
const Carousel = React.createClass({ | ||
@@ -44,3 +57,3 @@ displayName: 'Carousel', | ||
edgeEasing: 'easeOutElastic', | ||
framePadding: "0px", | ||
framePadding: '0px', | ||
slidesToShow: 1, | ||
@@ -50,3 +63,3 @@ slidesToScroll: 1, | ||
speed: 500, | ||
width: "100%" | ||
width: '100%' | ||
} | ||
@@ -352,5 +365,8 @@ }, | ||
var self = this; | ||
window.onresize = function() { | ||
addEvent(window, 'resize', function() { | ||
self.setDimensions(); | ||
} | ||
}); | ||
addEvent(document, 'readystatechange', function() { | ||
self.setDimensions(); | ||
}); | ||
}, | ||
@@ -407,3 +423,3 @@ | ||
left: this.getTweeningValue('left'), | ||
margin: "0px " + (this.props.cellSpacing / 2) * -1 + "px", | ||
margin: '0px ' + (this.props.cellSpacing / 2) * -1 + 'px', | ||
padding: 0, | ||
@@ -410,0 +426,0 @@ width: listWidth + spacingOffset, |
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
53053
1456