Skip to content

Commit 72fc98a

Browse files
committed
Generating version 0.1.1 for NPN
1 parent 5726925 commit 72fc98a

File tree

6 files changed

+16
-30
lines changed

6 files changed

+16
-30
lines changed

lib/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# React Responsive Carousel (WIP)
22

3+
* Note: This version `0.1.1` was updated for use with React `0.13.3`. For React < `0.13.0` try the version `0.1.0`;
34

45
## Demo
56

lib/__tests__/Carousel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("Carousel", function() {
3131
afterEach(function() {
3232
if (componentInstance && componentInstance.isMounted()) {
3333
// Only components with a parent will be unmounted
34-
React.unmountComponentAtNode(componentInstance.getDOMNode().parent);
34+
React.unmountComponentAtNode(componentInstance.getDOMNode());
3535
}
3636
});
3737

lib/__tests__/ImageGallery.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,10 @@ describe("ImageGallery", function() {
2929
afterEach(function() {
3030
if (componentInstance && componentInstance.isMounted()) {
3131
// Only components with a parent will be unmounted
32-
React.unmountComponentAtNode(componentInstance.getDOMNode().parent);
32+
React.unmountComponentAtNode(componentInstance.getDOMNode());
3333
}
3434
});
3535

36-
it("should be an instance of component", function(){
37-
expect(TestUtils.isCompositeComponent(componentInstance)).toBe(true);
38-
});
39-
4036
it("Should have a state currentImage", function () {
4137
expect(componentInstance.state.currentImage).toBeDefined();
4238
});

lib/components/Carousel.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -214,20 +214,11 @@ module.exports = React.createClass({displayName: "exports",
214214

215215

216216
getTotalWidth:function () {
217-
if (this.isMounted()) {
218-
return this.lastElementPosition + outerWidth(this.lastElement.getDOMNode());
219-
} else {
220-
return 'auto';
221-
}
217+
return this.itemSize * this.props.items.length || 'auto';
222218
},
223219

224220
getNextPosition:function () {
225-
if (this.isMounted()) {
226-
var nextPosition = this.refs['item' + this.state.firstItem].getDOMNode().offsetLeft;
227-
return - nextPosition;
228-
} else {
229-
return 0;
230-
}
221+
return - this.itemSize * this.state.firstItem || 0;
231222
},
232223

233224
changeItem:function (e) {
@@ -274,7 +265,7 @@ module.exports = React.createClass({displayName: "exports",
274265
if (!this.props.showStatus) {
275266
return null
276267
}
277-
return React.createElement("p", {className: "carousel-status"}, this.state.selectedItem, " of ", this.props.items.length);
268+
return React.createElement("p", {className: "carousel-status"}, this.state.selectedItem + 1, " of ", this.props.items.length);
278269
},
279270

280271
render:function () {

lib/cssClasses.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
1-
var React = require('react/addons');
2-
var classSet = React.addons.classSet;
1+
var classNames = require('classnames');
32

43
module.exports = {
54
CAROUSEL:function (isSlider) {
6-
return classSet({
5+
return classNames({
76
"carousel": true,
87
"carousel-slider": isSlider
98
});
109
},
1110

1211
WRAPPER:function (isSlider) {
13-
return classSet({
12+
return classNames({
1413
"thumbs-wrapper": !isSlider,
1514
"slider-wrapper": isSlider
1615
});
1716
},
1817

1918
SLIDER:function (isSlider, isSwiping){
20-
return classSet({
19+
return classNames({
2120
"thumbs": !isSlider,
2221
"slider": isSlider,
2322
"swiping": isSwiping
2423
});
2524
},
2625

2726
ITEM:function (isSlider, index, selectedItem) {
28-
return classSet({
27+
return classNames({
2928
"thumb": !isSlider,
3029
"slide": isSlider,
3130
"selected": index === selectedItem
3231
});
3332
},
3433

3534
ARROW_LEFT:function (disabled) {
36-
return classSet({
35+
return classNames({
3736
"control-arrow control-left": true,
3837
"control-disabled": disabled
3938
});
4039
},
4140

4241
ARROW_RIGHT:function (disabled) {
43-
return classSet({
42+
return classNames({
4443
"control-arrow control-right": true,
4544
"control-disabled": disabled
4645
})
4746
},
4847

4948
DOT:function (selected) {
50-
return classSet({
49+
return classNames({
5150
"dot": true,
5251
'selected': selected
5352
})

lib/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-responsive-carousel",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "React Responsive Carousel",
55
"author": {
66
"name": "Leandro Augusto Lemos",
@@ -29,7 +29,6 @@
2929
},
3030
"homepage": "http://leandrowd.github.io/react-responsive-carousel/",
3131
"dependencies": {
32-
"react": "~0.12.2",
33-
"react-addons": "^0.9.0"
32+
"react": "^0.13.3"
3433
}
3534
}

0 commit comments

Comments
 (0)