Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add data 'route' when dispatch Actions BEFORE_FOCUS, AFTER_FOCUS
  • Loading branch information
jungsoo108 committed Feb 18, 2016
commit 97ef6b199c2bc3649cbaa2dd63ccb234ea4ba37d
16 changes: 10 additions & 6 deletions Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,28 @@ export default class Router extends React.Component {

if (this.props.dispatch) {
this.router.delegate.refs.nav.navigationContext.addListener('willfocus', function (ev) {
let name = ev.data.route.name;
let title = ev.data.route.title;
let route = ev.data.route;
let name = route.name;
let title = route.title;

this.props.dispatch({
type: Actions.BEFORE_FOCUS,
name: name,
title: title
title: title,
route: route
});
}.bind(this));

this.router.delegate.refs.nav.navigationContext.addListener('didfocus', function (ev) {
let name = ev.data.route.name;
let title = ev.data.route.title;
let route = ev.data.route;
let name = route.name;
let title = route.title;

this.props.dispatch({
type: Actions.AFTER_FOCUS,
name: name,
title: title
title: title,
route: route
});
}.bind(this));
}
Expand Down