Fix transitions between components

This commit is contained in:
Tautvidas Sipavičius
2015-10-22 13:18:40 +03:00
parent e13df4d794
commit 22949b77ce
3 changed files with 7 additions and 7 deletions

View File

@ -25,9 +25,9 @@ if(container) {
<Route path="/" component={ App }> <Route path="/" component={ App }>
<IndexRoute component={ NewsletterList } /> <IndexRoute component={ NewsletterList } />
<Route path="new" component={ NewsletterTypes } /> <Route path="new" component={ NewsletterTypes } />
<Route name="standard" path="new/standard" handler={ NewsletterStandard } /> <Route name="standard" path="new/standard" component={ NewsletterStandard } />
<Route name="welcome" path="new/welcome" handler={ NewsletterWelcome } /> <Route name="welcome" path="new/welcome" component={ NewsletterWelcome } />
<Route name="template" path="template/:id" handler={ NewsletterTemplates } /> <Route name="template" path="template/:id" component={ NewsletterTemplates } />
<Route path="send/:id" component={ NewsletterSend } /> <Route path="send/:id" component={ NewsletterSend } />
<Route path="*" component={ NewsletterList } /> <Route path="*" component={ NewsletterList } />
</Route> </Route>

View File

@ -18,10 +18,10 @@ define(
var NewsletterStandard = React.createClass({ var NewsletterStandard = React.createClass({
mixins: [ mixins: [
Router.Navigation Router.History
], ],
showTemplateSelection: function(newsletterId) { showTemplateSelection: function(newsletterId) {
this.transitionTo('/template/' + newsletterId); this.history.pushState(null, `/template/${newsletterId}`);
}, },
componentDidMount: function() { componentDidMount: function() {
// No options for this type, create a newsletter upon mounting // No options for this type, create a newsletter upon mounting

View File

@ -66,7 +66,7 @@ define(
var NewsletterWelcome = React.createClass({ var NewsletterWelcome = React.createClass({
mixins: [ mixins: [
Router.Navigation Router.History
], ],
getInitialState: function() { getInitialState: function() {
return { return {
@ -121,7 +121,7 @@ define(
}.bind(this)); }.bind(this));
}, },
showTemplateSelection: function(newsletterId) { showTemplateSelection: function(newsletterId) {
this.transitionTo('/template/' + newsletterId); this.history.pushState(null, `/template/${newsletterId}`);
}, },
render: function() { render: function() {
var roleListSelection, timeNumber; var roleListSelection, timeNumber;