Skip to content

Commit

Permalink
Generating version 0.1.1 for NPN
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrowd committed May 17, 2015
1 parent 5726925 commit 72fc98a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
1 change: 1 addition & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# React Responsive Carousel (WIP)

* 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`;

## Demo

Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("Carousel", function() {
afterEach(function() {
if (componentInstance && componentInstance.isMounted()) {
// Only components with a parent will be unmounted
React.unmountComponentAtNode(componentInstance.getDOMNode().parent);
React.unmountComponentAtNode(componentInstance.getDOMNode());
}
});

Expand Down
6 changes: 1 addition & 5 deletions lib/__tests__/ImageGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ describe("ImageGallery", function() {
afterEach(function() {
if (componentInstance && componentInstance.isMounted()) {
// Only components with a parent will be unmounted
React.unmountComponentAtNode(componentInstance.getDOMNode().parent);
React.unmountComponentAtNode(componentInstance.getDOMNode());
}
});

it("should be an instance of component", function(){
expect(TestUtils.isCompositeComponent(componentInstance)).toBe(true);
});

it("Should have a state currentImage", function () {
expect(componentInstance.state.currentImage).toBeDefined();
});
Expand Down
15 changes: 3 additions & 12 deletions lib/components/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,11 @@ module.exports = React.createClass({displayName: "exports",


getTotalWidth:function () {
if (this.isMounted()) {
return this.lastElementPosition + outerWidth(this.lastElement.getDOMNode());
} else {
return 'auto';
}
return this.itemSize * this.props.items.length || 'auto';
},

getNextPosition:function () {
if (this.isMounted()) {
var nextPosition = this.refs['item' + this.state.firstItem].getDOMNode().offsetLeft;
return - nextPosition;
} else {
return 0;
}
return - this.itemSize * this.state.firstItem || 0;
},

changeItem:function (e) {
Expand Down Expand Up @@ -274,7 +265,7 @@ module.exports = React.createClass({displayName: "exports",
if (!this.props.showStatus) {
return null
}
return React.createElement("p", {className: "carousel-status"}, this.state.selectedItem, " of ", this.props.items.length);
return React.createElement("p", {className: "carousel-status"}, this.state.selectedItem + 1, " of ", this.props.items.length);
},

render:function () {
Expand Down
17 changes: 8 additions & 9 deletions lib/cssClasses.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
var React = require('react/addons');
var classSet = React.addons.classSet;
var classNames = require('classnames');

module.exports = {
CAROUSEL:function (isSlider) {
return classSet({
return classNames({
"carousel": true,
"carousel-slider": isSlider
});
},

WRAPPER:function (isSlider) {
return classSet({
return classNames({
"thumbs-wrapper": !isSlider,
"slider-wrapper": isSlider
});
},

SLIDER:function (isSlider, isSwiping){
return classSet({
return classNames({
"thumbs": !isSlider,
"slider": isSlider,
"swiping": isSwiping
});
},

ITEM:function (isSlider, index, selectedItem) {
return classSet({
return classNames({
"thumb": !isSlider,
"slide": isSlider,
"selected": index === selectedItem
});
},

ARROW_LEFT:function (disabled) {
return classSet({
return classNames({
"control-arrow control-left": true,
"control-disabled": disabled
});
},

ARROW_RIGHT:function (disabled) {
return classSet({
return classNames({
"control-arrow control-right": true,
"control-disabled": disabled
})
},

DOT:function (selected) {
return classSet({
return classNames({
"dot": true,
'selected': selected
})
Expand Down
5 changes: 2 additions & 3 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-responsive-carousel",
"version": "0.1.0",
"version": "0.1.1",
"description": "React Responsive Carousel",
"author": {
"name": "Leandro Augusto Lemos",
Expand Down Expand Up @@ -29,7 +29,6 @@
},
"homepage": "http://leandrowd.github.io/react-responsive-carousel/",
"dependencies": {
"react": "~0.12.2",
"react-addons": "^0.9.0"
"react": "^0.13.3"
}
}

0 comments on commit 72fc98a

Please sign in to comment.