Skip to content

Commit

Permalink
Move makePath/Href to Router.Transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Oct 3, 2014
1 parent 637c0ac commit c5d6051
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
17 changes: 1 addition & 16 deletions modules/mixins/RouteLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ var React = require('react');
var RouteLookup = {

contextTypes: {
routeContainer: React.PropTypes.any.isRequired,
pathDelegate: React.PropTypes.any.isRequired
routeContainer: React.PropTypes.any.isRequired
},

/**
Expand All @@ -30,20 +29,6 @@ var RouteLookup = {
*/
getRouteByName: function (routeName) {
return this.context.routeContainer.getRouteByName(routeName);
},

/**
* See PathDelegate#makePath.
*/
makePath: function (to, params, query) {
return this.context.pathDelegate.makePath(to, params, query);
},

/**
* See PathDelegate#makeHref.
*/
makeHref: function (to, params, query) {
return this.context.pathDelegate.makeHref(to, params, query);
}

};
Expand Down
20 changes: 17 additions & 3 deletions modules/mixins/Transitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,39 @@ var Transitions = {
pathDelegate: React.PropTypes.any.isRequired
},

/**
* See PathDelegate#makePath.
*/
makePath: function (to, params, query) {
return this.context.pathDelegate.makePath(to, params, query);
},

/**
* See PathDelegate#makeHref.
*/
makeHref: function (to, params, query) {
return this.context.pathDelegate.makeHref(to, params, query);
},

/**
* See PathDelegate#transitionTo.
*/
transitionTo: function (to, params, query) {
return this.context.pathDelegate.transitionTo(to, params, query, this);
return this.context.pathDelegate.transitionTo(to, params, query);
},

/**
* See PathDelegate#replaceWith.
*/
replaceWith: function (to, params, query) {
return this.context.pathDelegate.replaceWith(to, params, query, this);
return this.context.pathDelegate.replaceWith(to, params, query);
},

/**
* See PathDelegate#goBack.
*/
goBack: function () {
return this.context.pathDelegate.goBack(this);
return this.context.pathDelegate.goBack();
}

};
Expand Down

0 comments on commit c5d6051

Please sign in to comment.