Skip to content

Commit 3713d68

Browse files
committedSep 10, 2016
Updating editor config properties and reformatting files
1 parent c946ce7 commit 3713d68

8 files changed

+83
-78
lines changed
 

‎.editorconfig

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
root = true
22

33
[*]
4-
indent_style = tab
4+
indent_style = space
5+
indent_size = 4
6+
spaces_around_brackets = both
57
end_of_line = lf
68
charset = utf-8
79
trim_trailing_whitespace = true
810
insert_final_newline = true
911

12+
[*.md]
13+
trim_trailing_whitespace = false
14+
1015
[{package.json,*.yml}]
1116
indent_style = space
1217
indent_size = 2

‎src/CSSTranslate.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = function (position, axis) {
44
var _has3d = has3d();
55
var positionCss = (axis === 'horizontal') ? [position, 0] : [0, position];
66
var transitionProp = _has3d ? 'translate3d' : 'translate';
7-
7+
88
if (_has3d) {
99
// adds z position
1010
positionCss.push(0);
@@ -13,4 +13,4 @@ module.exports = function (position, axis) {
1313
var translatedPosition = '(' + positionCss.join(',') + ')';
1414

1515
return transitionProp + translatedPosition;
16-
};
16+
};

‎src/components/Carousel.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -60,63 +60,63 @@ module.exports = React.createClass({
6060
},
6161

6262
componentDidMount (nextProps) {
63-
this.bindEvents();
63+
this.bindEvents();
6464

65-
var images = ReactDOM.findDOMNode(this.item0).getElementsByTagName('img');
65+
var images = ReactDOM.findDOMNode(this.item0).getElementsByTagName('img');
6666
var initialImage = images && images[this.props.selectedItem];
6767

6868
if (initialImage) {
69-
// if it's a carousel of images, we set the mount state after the first image is loaded
70-
initialImage.addEventListener('load', this.setMountState);
69+
// if it's a carousel of images, we set the mount state after the first image is loaded
70+
initialImage.addEventListener('load', this.setMountState);
7171
} else {
72-
this.setMountState();
72+
this.setMountState();
7373
}
7474
},
7575

7676
bindEvents () {
77-
// as the widths are calculated, we need to resize
77+
// as the widths are calculated, we need to resize
7878
// the carousel when the window is resized
7979
window.addEventListener("resize", this.updateSizes);
8080
// issue #2 - image loading smaller
8181
window.addEventListener("DOMContentLoaded", this.updateSizes);
8282

8383
if (this.props.useKeyboardArrows) {
84-
document.addEventListener("keydown", this.navigateWithKeyboard);
84+
document.addEventListener("keydown", this.navigateWithKeyboard);
8585
}
8686
},
8787

8888
unbindEvents () {
89-
// removing listeners
89+
// removing listeners
9090
window.removeEventListener("resize", this.updateSizes);
9191
window.removeEventListener("DOMContentLoaded", this.updateSizes);
9292

9393
if (this.props.useKeyboardArrows) {
94-
document.removeEventListener("keydown", this.navigateWithKeyboard);
94+
document.removeEventListener("keydown", this.navigateWithKeyboard);
9595
}
9696
},
9797

9898
navigateWithKeyboard (e) {
99-
var nextKeys = ['ArrowDown', 'ArrowRight'];
100-
var prevKeys = ['ArrowUp', 'ArrowLeft'];
101-
var allowedKeys = nextKeys.concat(prevKeys);
102-
103-
if (allowedKeys.indexOf(e.key) > -1) {
104-
if (nextKeys.indexOf(e.key) > -1) {
105-
this.increment();
106-
} else if (prevKeys.indexOf(e.key) > -1) {
107-
this.decrement();
108-
}
109-
}
99+
var nextKeys = ['ArrowDown', 'ArrowRight'];
100+
var prevKeys = ['ArrowUp', 'ArrowLeft'];
101+
var allowedKeys = nextKeys.concat(prevKeys);
102+
103+
if (allowedKeys.indexOf(e.key) > -1) {
104+
if (nextKeys.indexOf(e.key) > -1) {
105+
this.increment();
106+
} else if (prevKeys.indexOf(e.key) > -1) {
107+
this.decrement();
108+
}
109+
}
110110
},
111111

112112
updateSizes () {
113-
var isHorizontal = this.props.axis === 'horizontal';
114-
var firstItem = ReactDOM.findDOMNode(this.item0);
113+
var isHorizontal = this.props.axis === 'horizontal';
114+
var firstItem = ReactDOM.findDOMNode(this.item0);
115115
var itemSize = isHorizontal ? firstItem.clientWidth : firstItem.clientHeight;
116116

117117
this.setState({
118-
itemSize: itemSize,
119-
wrapperSize: isHorizontal ? itemSize * this.props.children.length : itemSize
118+
itemSize: itemSize,
119+
wrapperSize: isHorizontal ? itemSize * this.props.children.length : itemSize
120120
});
121121
},
122122

‎src/cssClasses.js

+45-45
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
var classNames = require('classnames');
22

33
module.exports = {
4-
CAROUSEL (isSlider) {
5-
return classNames({
6-
"carousel": true,
7-
"carousel-slider": isSlider
8-
});
9-
},
4+
CAROUSEL (isSlider) {
5+
return classNames({
6+
"carousel": true,
7+
"carousel-slider": isSlider
8+
});
9+
},
1010

11-
WRAPPER (isSlider, axis) {
12-
return classNames({
13-
"thumbs-wrapper": !isSlider,
14-
"slider-wrapper": isSlider,
15-
"axis-horizontal": axis === "horizontal",
16-
"axis-vertical": axis !== "horizontal"
17-
});
18-
},
11+
WRAPPER (isSlider, axis) {
12+
return classNames({
13+
"thumbs-wrapper": !isSlider,
14+
"slider-wrapper": isSlider,
15+
"axis-horizontal": axis === "horizontal",
16+
"axis-vertical": axis !== "horizontal"
17+
});
18+
},
1919

20-
SLIDER (isSlider, isSwiping){
21-
return classNames({
22-
"thumbs": !isSlider,
23-
"slider": isSlider,
24-
"animated": !isSwiping
25-
});
26-
},
20+
SLIDER (isSlider, isSwiping){
21+
return classNames({
22+
"thumbs": !isSlider,
23+
"slider": isSlider,
24+
"animated": !isSwiping
25+
});
26+
},
2727

28-
ITEM (isSlider, selected) {
29-
return classNames({
30-
"thumb": !isSlider,
31-
"slide": isSlider,
28+
ITEM (isSlider, selected) {
29+
return classNames({
30+
"thumb": !isSlider,
31+
"slide": isSlider,
3232
"selected": selected
33-
});
34-
},
33+
});
34+
},
3535

36-
ARROW_PREV (disabled) {
37-
return classNames({
38-
"control-arrow control-prev": true,
39-
"control-disabled": disabled
40-
});
41-
},
36+
ARROW_PREV (disabled) {
37+
return classNames({
38+
"control-arrow control-prev": true,
39+
"control-disabled": disabled
40+
});
41+
},
4242

43-
ARROW_NEXT (disabled) {
44-
return classNames({
45-
"control-arrow control-next": true,
46-
"control-disabled": disabled
47-
})
48-
},
43+
ARROW_NEXT (disabled) {
44+
return classNames({
45+
"control-arrow control-next": true,
46+
"control-disabled": disabled
47+
})
48+
},
4949

50-
DOT (selected) {
51-
return classNames({
52-
"dot": true,
53-
'selected': selected
54-
})
55-
}
50+
DOT (selected) {
51+
return classNames({
52+
"dot": true,
53+
'selected': selected
54+
})
55+
}
5656
}

‎src/dimensions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ module.exports = {
55

66
width += parseInt(style.marginLeft) + parseInt(style.marginRight);
77
return width;
8-
}
9-
}
8+
}
9+
}

‎src/has3d.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = function has3d() {
33
return false;
44
}
55

6-
var el = document.createElement('p'),
6+
var el = document.createElement('p'),
77
has3d,
88
transforms = {
99
'webkitTransform':'-webkit-transform',
@@ -26,4 +26,4 @@ module.exports = function has3d() {
2626
document.body.removeChild(el);
2727

2828
return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
29-
}
29+
}

‎src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
Carousel: require('./components/Carousel'),
33
Thumbs: require('./components/Thumbs')
4-
}
4+
}

‎src/object-assign.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ module.exports = function (target) {
1515
}
1616
}
1717
return output;
18-
};
18+
};

0 commit comments

Comments
 (0)
Please sign in to comment.