File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,15 @@ issues.TitleView = Backbone.View.extend({
31
31
location . origin = location . protocol + '//' + location . host ;
32
32
}
33
33
34
- // Only go back in history if we came from the /issues page.
35
- if ( document . referrer . indexOf ( location . origin + '/issues' ) === 0 ) {
34
+ // Only go back in history if we came from the /issues page and there's
35
+ // actually some history to go back to
36
+ if ( ( document . referrer . indexOf ( location . origin + '/issues' ) === 0 ) &&
37
+ ( history . length !== 1 ) ) {
36
38
history . back ( ) ;
37
- // If there's nothing to go back to (link opened in new tab, for example)
38
- // just go back to /issues.
39
- } else if ( history . length === 1 ) {
40
- window . location = '/issues' ;
39
+ e . preventDefault ( ) ;
40
+ } else {
41
+ location . href = '/issues' ;
41
42
}
42
-
43
- e . preventDefault ( ) ;
44
43
}
45
44
} ) ;
46
45
You can’t perform that action at this time.
0 commit comments