Skip to content

Commit c3b41af

Browse files
committed
fix typos, and remove comments
1 parent 411050b commit c3b41af

14 files changed

Lines changed: 43 additions & 58 deletions

src/Collapse.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/*eslint-disable react/prop-types */
2-
'use strict';
31
import React from 'react';
42
import Transition from './Transition';
53
import domUtils from './utils/domUtils';
@@ -122,7 +120,7 @@ Collapse.propTypes = {
122120
in: React.PropTypes.bool,
123121

124122
/**
125-
* Provide the durration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
123+
* Provide the duration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
126124
* original browser transition end events are canceled.
127125
*/
128126
duration: React.PropTypes.number,
@@ -140,7 +138,7 @@ Collapse.propTypes = {
140138

141139
/**
142140
* A function that returns the height or width of the animating DOM node. Allows for providing some custom logic how much
143-
* Collapse component should animation in its specified dimension.
141+
* Collapse component should animate in its specified dimension.
144142
*
145143
* `getDimensionValue` is called with the current dimension prop value and the DOM node.
146144
*/

src/CollapsibleMixin.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React from 'react';
22
import TransitionEvents from './utils/TransitionEvents';
3+
import deprecationWarning from './utils/deprecationWarning';
4+
5+
let warned = false;
36

47
const CollapsibleMixin = {
58

@@ -21,6 +24,13 @@ const CollapsibleMixin = {
2124
};
2225
},
2326

27+
componentWillMount(){
28+
if ( !warned ){
29+
deprecationWarning('CollapsibleMixin', 'Collapse Component');
30+
warned = true;
31+
}
32+
},
33+
2434
componentWillUpdate(nextProps, nextState){
2535
let willExpanded = nextProps.expanded != null ? nextProps.expanded : nextState.expanded;
2636
if (willExpanded === this.isExpanded()) {

src/CollapsibleNav.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,6 @@ const CollapsibleNav = React.createClass({
1919
},
2020

2121

22-
// getCollapsibleDimensionValue() {
23-
// let height = 0;
24-
// let nodes = this.refs;
25-
// for (let key in nodes) {
26-
// if (nodes.hasOwnProperty(key)) {
27-
28-
// let n = React.findDOMNode(nodes[key]);
29-
// let h = n.offsetHeight;
30-
// let computedStyles = domUtils.getComputedStyles(n);
31-
32-
// height += (h +
33-
// parseInt(computedStyles.marginTop, 10) +
34-
// parseInt(computedStyles.marginBottom, 10)
35-
// );
36-
// }
37-
// }
38-
// return height;
39-
// },
40-
4122
render() {
4223
/*
4324
* this.props.collapsible is set in NavBar when an eventKey is supplied.

src/Fade.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
import React from 'react';
32
import Transition from './Transition';
43

@@ -30,7 +29,7 @@ Fade.propTypes = {
3029
in: React.PropTypes.bool,
3130

3231
/**
33-
* Provide the durration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
32+
* Provide the duration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
3433
* original browser transition end events are canceled.
3534
*/
3635
duration: React.PropTypes.number,

src/FadeMixin.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import domUtils from './utils/domUtils';
3+
import deprecationWarning from './utils/deprecationWarning';
34

45
// TODO: listen for onTransitionEnd to remove el
56
function getElementsAndSelf (root, classes){
@@ -16,7 +17,16 @@ function getElementsAndSelf (root, classes){
1617
return els;
1718
}
1819

20+
let warned = false;
21+
1922
export default {
23+
componentWillMount(){
24+
if ( !warned ){
25+
deprecationWarning('FadeMixin', 'Fade Component');
26+
warned = true;
27+
}
28+
},
29+
2030
_fadeIn() {
2131
let els;
2232

src/Modal.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ function getScrollbarSize(){
9696

9797
const ModalMarkup = React.createClass({
9898

99-
<<<<<<< HEAD
100-
mixins: [ BootstrapMixin, FadeMixin ],
101-
=======
10299
mixins: [ BootstrapMixin ],
103-
>>>>>>> [added] Fade Component, replaces FadeMixin
104100

105101
propTypes: {
106102

src/Position.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ class Position extends React.Component {
6565
let target = React.findDOMNode(this.props.target(this.props));
6666
let container = React.findDOMNode(this.props.container) || domUtils.ownerDocument(this).body;
6767

68-
// if ( !overlay || !target || !container ){
69-
// return;
70-
// }
71-
7268
this.setState(
7369
calcOverlayPosition(
7470
this.props.placement

src/Transition.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
import React from 'react';
32
import TransitionEvents from './utils/TransitionEvents';
43
import classnames from 'classnames';
@@ -163,8 +162,8 @@ class Transition extends React.Component {
163162

164163
let classes = '';
165164

166-
// for whatever reason classnames() doesn't actually work here,
167-
// maybe because they aren't always single classes?
165+
// using `classnames()` here causes a subtle bug,
166+
// hence the verbose if/else if sequence.
168167
if (this.state.in && !this.state.transitioning) {
169168
classes = this.props.enteredClassName;
170169
}
@@ -184,9 +183,9 @@ class Transition extends React.Component {
184183
return React.cloneElement(child, {
185184
...childProps,
186185
className: classnames(
187-
child.props.className
188-
, this.props.className
189-
, classes)
186+
child.props.className,
187+
this.props.className,
188+
classes)
190189
});
191190
}
192191
}
@@ -208,7 +207,7 @@ Transition.propTypes = {
208207
transitionAppear: React.PropTypes.bool,
209208

210209
/**
211-
* Provide the durration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
210+
* Provide the duration of the animation in milliseconds, used to ensure that finishing callbacks are fired even if the
212211
* original browser transition end events are canceled.
213212
*/
214213
duration: React.PropTypes.number,

test/CollapsibleMixinSpec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ describe('CollapsibleMixin', function () {
3232
});
3333
});
3434

35+
afterEach(()=> {
36+
if (console.warn.calledWithMatch('CollapsibleMixin is deprecated')){
37+
console.warn.reset();
38+
}
39+
});
40+
3541
describe('getInitialState', function(){
3642
it('Should check defaultExpanded', function () {
3743
instance = ReactTestUtils.renderIntoDocument(

test/FadeMixinSpec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ describe('FadeMixin', function () {
1919
});
2020
});
2121

22+
afterEach(()=> {
23+
if (console.warn.calledWithMatch('FadeMixin is deprecated')){
24+
console.warn.reset();
25+
}
26+
});
27+
28+
2229
it('Should add the in class to all elements', function (done) {
2330
let instance = ReactTestUtils.renderIntoDocument(<Component />);
2431

0 commit comments

Comments
 (0)