From c5d6051c81b9c2ac4e9540c5834280d585a0387b Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Fri, 3 Oct 2014 06:58:28 -0700 Subject: [PATCH] Move makePath/Href to Router.Transitions --- modules/mixins/RouteLookup.js | 17 +---------------- modules/mixins/Transitions.js | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/modules/mixins/RouteLookup.js b/modules/mixins/RouteLookup.js index da919d92c4..07a250fc92 100644 --- a/modules/mixins/RouteLookup.js +++ b/modules/mixins/RouteLookup.js @@ -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 }, /** @@ -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); } }; diff --git a/modules/mixins/Transitions.js b/modules/mixins/Transitions.js index 0018b3e9a5..6d0cf7467a 100644 --- a/modules/mixins/Transitions.js +++ b/modules/mixins/Transitions.js @@ -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(); } };