File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -101,26 +101,25 @@ var CaptureClicks = React.createClass({
101
101
el . blur ( ) ;
102
102
e . preventDefault ( ) ;
103
103
104
- // flag if we already found a "not found" case and bailed
105
- var bail = false ;
104
+ // Mark if any of our routers matched. If they didn't, we'll call gotoURL.
105
+ var matched = false ;
106
106
107
107
var onBeforeNavigation = function ( path , navigation , match ) {
108
- if ( bail ) {
109
- return false ;
110
- } else if ( ! match || ! match . match ) {
111
- bail = true ;
112
- this . props . gotoURL ( el . href ) ;
113
- return false ;
108
+ if ( match && match . match ) {
109
+ matched = true ;
114
110
}
115
- } . bind ( this ) ;
111
+ }
116
112
113
+ var gotoURL = this . props . gotoURL ;
117
114
this . props . environment . navigate (
118
115
url . pathname + ( url . hash . length > 1 ? url . hash : '' ) ,
119
116
{ onBeforeNavigation : onBeforeNavigation } ,
120
117
function ( err , info ) {
121
118
if ( err ) {
122
119
throw err ;
123
120
}
121
+ // No routers matched - so we'll escape out using gotoURL.
122
+ if ( ! matched ) gotoURL ( el . href ) ;
124
123
} ) ;
125
124
} ,
126
125
You can’t perform that action at this time.
0 commit comments