Skip to content

Commit 147f463

Browse files
committed
ES6 syntax
1 parent 52e7ab8 commit 147f463

File tree

10 files changed

+89
-89
lines changed

10 files changed

+89
-89
lines changed

_src/app/docs/src/Defs.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var defs = require('../../../resources/immutable.d.json');
77

88

99
var InterfaceDef = React.createClass({
10-
render: function() {
10+
render() {
1111
var name = this.props.name;
1212
var def = this.props.def;
1313
return (
@@ -40,7 +40,7 @@ exports.InterfaceDef = InterfaceDef;
4040

4141

4242
var CallSigDef = React.createClass({
43-
render: function() {
43+
render() {
4444
var info = this.props.info;
4545
var module = this.props.module;
4646
var name = this.props.name;
@@ -70,7 +70,7 @@ exports.CallSigDef = CallSigDef;
7070

7171

7272
var TypeDef = React.createClass({
73-
render: function() {
73+
render() {
7474
var info = this.props.info;
7575
var type = this.props.type;
7676
var prefix = this.props.prefix;
@@ -129,16 +129,16 @@ var TypeDef = React.createClass({
129129
throw new Error('Unknown kind ' + type.k);
130130
},
131131

132-
mouseOver: function(event) {
132+
mouseOver(event) {
133133
CSSCore.addClass(this.getDOMNode(), 'over');
134134
event.stopPropagation();
135135
},
136136

137-
mouseOut: function() {
137+
mouseOut() {
138138
CSSCore.removeClass(this.getDOMNode(), 'over');
139139
},
140140

141-
wrap: function(className, child) {
141+
wrap(className, child) {
142142
return (
143143
<span
144144
className={'t ' + className}
@@ -154,7 +154,7 @@ exports.TypeDef = TypeDef;
154154

155155

156156
var MemberDef = React.createClass({
157-
render: function() {
157+
render() {
158158
var module = this.props.module;
159159
var member = this.props.member;
160160
return (

_src/app/docs/src/DocHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Logo = require('../../src/Logo');
44

55
var DocHeader = React.createClass({
66

7-
render: function() {
7+
render() {
88
return (
99
<div className="header">
1010
<div className="miniHeader">

_src/app/docs/src/DocOverview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var Markdown = require('./Markdown');
55

66
var DocOverview = React.createClass({
77

8-
render: function() {
8+
render() {
99
var def = this.props.def;
1010

1111
var doc = def.doc;

_src/app/docs/src/MemberDoc.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ var MarkDown = require('./MarkDown');
1111
var MemberDoc = React.createClass({
1212
mixins: [ PageDataMixin, Router.Navigation ],
1313

14-
getInitialState: function() {
14+
getInitialState() {
1515
var showDetail = this.props.showDetail;
1616
return { detail: showDetail };
1717
},
1818

19-
componentDidMount: function() {
19+
componentDidMount() {
2020
if (this.props.showDetail) {
2121
var node = this.getDOMNode();
2222
var navType = this.getPageData().type;
@@ -29,14 +29,14 @@ var MemberDoc = React.createClass({
2929
}
3030
},
3131

32-
componentWillReceiveProps: function(nextProps) {
32+
componentWillReceiveProps(nextProps) {
3333
if (nextProps.showDetail && !this.props.showDetail) {
3434
this.scrollTo = true;
3535
this.setState({ detail: true });
3636
}
3737
},
3838

39-
componentDidUpdate: function() {
39+
componentDidUpdate() {
4040
if (this.scrollTo) {
4141
this.scrollTo = false;
4242
var node = this.getDOMNode();
@@ -50,7 +50,7 @@ var MemberDoc = React.createClass({
5050
}
5151
},
5252

53-
toggleDetail: function() {
53+
toggleDetail() {
5454
// Note: removed this because it drops the URL bar on mobile, and that's
5555
// the only place it's currently being used.
5656
// var member = this.props.member;
@@ -65,7 +65,7 @@ var MemberDoc = React.createClass({
6565
this.setState({ detail: !this.state.detail });
6666
},
6767

68-
render: function() {
68+
render() {
6969
var typePropMap = this.props.typePropMap;
7070
var member = this.props.member;
7171
var module = member.isStatic ? this.props.parentName : null;
@@ -160,15 +160,15 @@ function makeSlideDown(child) {
160160
}
161161

162162
var SlideDown = React.createClass({
163-
componentWillEnter: function(done) {
163+
componentWillEnter(done) {
164164
this.slide(false, done);
165165
},
166166

167-
componentWillLeave: function(done) {
167+
componentWillLeave(done) {
168168
this.slide(true, done);
169169
},
170170

171-
slide: function(slidingUp, done) {
171+
slide(slidingUp, done) {
172172
var node = this.getDOMNode();
173173
node.style.height = 'auto';
174174
var height = getComputedStyle(node).height;
@@ -187,7 +187,7 @@ var SlideDown = React.createClass({
187187
}, 17);
188188
},
189189

190-
render: function() {
190+
render() {
191191
return this.props.children;
192192
}
193193
});

_src/app/docs/src/PageDataMixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
/**
99
* Returns the most recent change event.
1010
*/
11-
getPageData: function () {
11+
getPageData() {
1212
return this.context.getPageData();
1313
}
1414
};

_src/app/docs/src/TypeDocumentation.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ var defs = require('../../../resources/immutable.d.json');
1313

1414

1515
var TypeDocumentation = React.createClass({
16-
getInitialState: function() {
16+
getInitialState() {
1717
return {
1818
showInherited: true,
1919
showInGroups: true,
2020
};
2121
},
2222

23-
toggleShowInGroups: function() {
23+
toggleShowInGroups() {
2424
this.setState({ showInGroups: !this.state.showInGroups });
2525
},
2626

27-
toggleShowInherited: function() {
27+
toggleShowInherited() {
2828
this.setState({ showInherited: !this.state.showInherited });
2929
},
3030

31-
render: function() {
31+
render() {
3232
var name = this.props.name;
3333
var memberName = this.props.memberName;
3434
var def = this.props.def;
@@ -79,13 +79,13 @@ var TypeDocumentation = React.createClass({
7979
});
8080

8181
var NotFound = React.createClass({
82-
render: function() {
82+
render() {
8383
return <div>{'Not found'}</div>;
8484
}
8585
});
8686

8787
var FunctionDoc = React.createClass({
88-
render: function() {
88+
render() {
8989
var name = this.props.name;
9090
var def = this.props.def;
9191
var doc = def.doc || {};
@@ -129,7 +129,7 @@ var FunctionDoc = React.createClass({
129129
});
130130

131131
var TypeDoc = React.createClass({
132-
render: function() {
132+
render() {
133133
var name = this.props.name;
134134
var def = this.props.def;
135135
var memberName = this.props.memberName;

_src/app/docs/src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var isMobile = require('./isMobile');
99

1010

1111
var Documentation = React.createClass({
12-
render: function () {
12+
render() {
1313
return (
1414
<div className={isMobile ? 'mobile' : null}>
1515
<DocHeader />
@@ -26,7 +26,7 @@ var Documentation = React.createClass({
2626
var DocDeterminer = React.createClass({
2727
mixins: [ Router.State ],
2828

29-
render: function () {
29+
render() {
3030
var { def, name, memberName } = determineDoc(this.getPath());
3131
return (
3232
<TypeDocumentation
@@ -58,17 +58,17 @@ module.exports = React.createClass({
5858
getPageData: React.PropTypes.func.isRequired,
5959
},
6060

61-
getChildContext: function () {
61+
getChildContext() {
6262
return {
6363
getPageData: this.getPageData,
6464
};
6565
},
6666

67-
getPageData: function () {
67+
getPageData() {
6868
return this.pageData;
6969
},
7070

71-
componentWillMount: function() {
71+
componentWillMount() {
7272
var location, scrollBehavior;
7373

7474
if (window.document) {
@@ -115,15 +115,15 @@ module.exports = React.createClass({
115115

116116
// TODO: replace this. this is hacky and probably wrong
117117

118-
componentDidMount: function() {
118+
componentDidMount() {
119119
setTimeout(() => { this.pageData.type = ''; }, 0);
120120
},
121121

122-
componentDidUpdate: function() {
122+
componentDidUpdate() {
123123
setTimeout(() => { this.pageData.type = ''; }, 0);
124124
},
125125

126-
render: function () {
126+
render () {
127127
var Handler = this.state.handler;
128128
return <Handler />;
129129
}

0 commit comments

Comments
 (0)