11var LocationDispatcher = require ( '../dispatchers/LocationDispatcher' ) ;
2+ var isAbsoluteURL = require ( '../utils/isAbsoluteURL' ) ;
23var makePath = require ( '../utils/makePath' ) ;
34
5+ function loadURL ( url ) {
6+ window . location = url ;
7+ }
8+
49/**
510 * Actions that modify the URL.
611 */
@@ -16,21 +21,29 @@ var LocationActions = {
1621 * a new URL onto the history stack.
1722 */
1823 transitionTo : function ( to , params , query ) {
19- LocationDispatcher . handleViewAction ( {
20- type : LocationActions . PUSH ,
21- path : makePath ( to , params , query )
22- } ) ;
24+ if ( isAbsoluteURL ( to ) ) {
25+ loadURL ( to ) ;
26+ } else {
27+ LocationDispatcher . handleViewAction ( {
28+ type : LocationActions . PUSH ,
29+ path : makePath ( to , params , query )
30+ } ) ;
31+ }
2332 } ,
2433
2534 /**
2635 * Transitions to the URL specified in the arguments by replacing
2736 * the current URL in the history stack.
2837 */
2938 replaceWith : function ( to , params , query ) {
30- LocationDispatcher . handleViewAction ( {
31- type : LocationActions . REPLACE ,
32- path : makePath ( to , params , query )
33- } ) ;
39+ if ( isAbsoluteURL ( to ) ) {
40+ loadURL ( to ) ;
41+ } else {
42+ LocationDispatcher . handleViewAction ( {
43+ type : LocationActions . REPLACE ,
44+ path : makePath ( to , params , query )
45+ } ) ;
46+ }
3447 } ,
3548
3649 /**
0 commit comments