Skip to content

Commit c5d6051

Browse files
committed
Move makePath/Href to Router.Transitions
1 parent 637c0ac commit c5d6051

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

modules/mixins/RouteLookup.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ var React = require('react');
77
var RouteLookup = {
88

99
contextTypes: {
10-
routeContainer: React.PropTypes.any.isRequired,
11-
pathDelegate: React.PropTypes.any.isRequired
10+
routeContainer: React.PropTypes.any.isRequired
1211
},
1312

1413
/**
@@ -30,20 +29,6 @@ var RouteLookup = {
3029
*/
3130
getRouteByName: function (routeName) {
3231
return this.context.routeContainer.getRouteByName(routeName);
33-
},
34-
35-
/**
36-
* See PathDelegate#makePath.
37-
*/
38-
makePath: function (to, params, query) {
39-
return this.context.pathDelegate.makePath(to, params, query);
40-
},
41-
42-
/**
43-
* See PathDelegate#makeHref.
44-
*/
45-
makeHref: function (to, params, query) {
46-
return this.context.pathDelegate.makeHref(to, params, query);
4732
}
4833

4934
};

modules/mixins/Transitions.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,39 @@ var Transitions = {
99
pathDelegate: React.PropTypes.any.isRequired
1010
},
1111

12+
/**
13+
* See PathDelegate#makePath.
14+
*/
15+
makePath: function (to, params, query) {
16+
return this.context.pathDelegate.makePath(to, params, query);
17+
},
18+
19+
/**
20+
* See PathDelegate#makeHref.
21+
*/
22+
makeHref: function (to, params, query) {
23+
return this.context.pathDelegate.makeHref(to, params, query);
24+
},
25+
1226
/**
1327
* See PathDelegate#transitionTo.
1428
*/
1529
transitionTo: function (to, params, query) {
16-
return this.context.pathDelegate.transitionTo(to, params, query, this);
30+
return this.context.pathDelegate.transitionTo(to, params, query);
1731
},
1832

1933
/**
2034
* See PathDelegate#replaceWith.
2135
*/
2236
replaceWith: function (to, params, query) {
23-
return this.context.pathDelegate.replaceWith(to, params, query, this);
37+
return this.context.pathDelegate.replaceWith(to, params, query);
2438
},
2539

2640
/**
2741
* See PathDelegate#goBack.
2842
*/
2943
goBack: function () {
30-
return this.context.pathDelegate.goBack(this);
44+
return this.context.pathDelegate.goBack();
3145
}
3246

3347
};

0 commit comments

Comments
 (0)