File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " nuka-carousel" ,
33 "main" : " index.js" ,
4- "version" : " 0.0.6 " ,
4+ "version" : " 0.0.7 " ,
55 "homepage" : " https://github.com/kenwheeler/nuka-carousel" ,
66 "authors" : [
77 " Ken Wheeler <ken_wheeler@me.com>"
Original file line number Diff line number Diff line change @@ -393,12 +393,17 @@ var Carousel = _React2['default'].createClass({
393393 var self = this ,
394394 slideWidth ,
395395 frame ;
396+
396397 frame = _React2 [ 'default' ] . findDOMNode ( this . refs . frame ) ;
398+
397399 if ( typeof this . props . slideWidth !== 'number' ) {
398400 slideWidth = parseInt ( this . props . slideWidth ) ;
399401 } else {
400402 slideWidth = frame . offsetWidth / this . props . slidesToShow * this . props . slideWidth ;
401403 }
404+
405+ slideWidth -= this . props . cellSpacing * ( ( 100 - 100 / this . props . slidesToShow ) / 100 ) ;
406+
402407 this . setState ( {
403408 frameWidth : frame . offsetWidth ,
404409 slideCount : this . props . children . length ,
Original file line number Diff line number Diff line change 11{
22 "name" : " nuka-carousel" ,
3- "version" : " 0.0.6 " ,
3+ "version" : " 0.0.7 " ,
44 "description" : " Pure React Carousel" ,
55 "main" : " index.js" ,
66 "dependencies" : {
Original file line number Diff line number Diff line change @@ -376,12 +376,17 @@ const Carousel = React.createClass({
376376
377377 setDimensions ( ) {
378378 var self = this , slideWidth , frame ;
379+
379380 frame = React . findDOMNode ( this . refs . frame ) ;
381+
380382 if ( typeof this . props . slideWidth !== 'number' ) {
381383 slideWidth = parseInt ( this . props . slideWidth ) ;
382384 } else {
383385 slideWidth = ( frame . offsetWidth / this . props . slidesToShow ) * this . props . slideWidth ;
384386 }
387+
388+ slideWidth -= this . props . cellSpacing * ( ( 100 - ( 100 / this . props . slidesToShow ) ) / 100 ) ;
389+
385390 this . setState ( {
386391 frameWidth : frame . offsetWidth ,
387392 slideCount : this . props . children . length ,
You can’t perform that action at this time.
0 commit comments