@@ -1594,9 +1594,9 @@ return /******/ (function(modules) { // webpackBootstrap
1594
1594
} ,
1595
1595
1596
1596
clearAllRoutes : function clearAllRoutes ( ) {
1597
- this . cancelPendingTransition ( ) ;
1598
- this . namedRoutes = { } ;
1599
- this . routes = [ ] ;
1597
+ Router . cancelPendingTransition ( ) ;
1598
+ Router . namedRoutes = { } ;
1599
+ Router . routes = [ ] ;
1600
1600
} ,
1601
1601
1602
1602
/**
@@ -1605,18 +1605,18 @@ return /******/ (function(modules) { // webpackBootstrap
1605
1605
addRoutes : function addRoutes ( routes ) {
1606
1606
if ( isReactChildren ( routes ) ) routes = createRoutesFromReactChildren ( routes ) ;
1607
1607
1608
- addRoutesToNamedRoutes ( routes , this . namedRoutes ) ;
1608
+ addRoutesToNamedRoutes ( routes , Router . namedRoutes ) ;
1609
1609
1610
- this . routes . push . apply ( this . routes , routes ) ;
1610
+ Router . routes . push . apply ( Router . routes , routes ) ;
1611
1611
} ,
1612
1612
1613
1613
/**
1614
1614
* Replaces routes of this router from the given children object (see ReactChildren).
1615
1615
*/
1616
1616
replaceRoutes : function replaceRoutes ( routes ) {
1617
- this . clearAllRoutes ( ) ;
1618
- this . addRoutes ( routes ) ;
1619
- this . refresh ( ) ;
1617
+ Router . clearAllRoutes ( ) ;
1618
+ Router . addRoutes ( routes ) ;
1619
+ Router . refresh ( ) ;
1620
1620
} ,
1621
1621
1622
1622
/**
@@ -1625,7 +1625,7 @@ return /******/ (function(modules) { // webpackBootstrap
1625
1625
* match can be made.
1626
1626
*/
1627
1627
match : function match ( path ) {
1628
- return Match . findMatch ( this . routes , path ) ;
1628
+ return Match . findMatch ( Router . routes , path ) ;
1629
1629
} ,
1630
1630
1631
1631
/**
@@ -1637,7 +1637,7 @@ return /******/ (function(modules) { // webpackBootstrap
1637
1637
if ( PathUtils . isAbsolute ( to ) ) {
1638
1638
path = to ;
1639
1639
} else {
1640
- var route = to instanceof Route ? to : this . namedRoutes [ to ] ;
1640
+ var route = to instanceof Route ? to : Router . namedRoutes [ to ] ;
1641
1641
1642
1642
invariant ( route instanceof Route , "Cannot find a route named \"%s\"" , to ) ;
1643
1643
@@ -1652,7 +1652,7 @@ return /******/ (function(modules) { // webpackBootstrap
1652
1652
* to the route with the given name, URL parameters, and query.
1653
1653
*/
1654
1654
makeHref : function makeHref ( to , params , query ) {
1655
- var path = this . makePath ( to , params , query ) ;
1655
+ var path = Router . makePath ( to , params , query ) ;
1656
1656
return location === HashLocation ? "#" + path : path ;
1657
1657
} ,
1658
1658
@@ -1661,7 +1661,7 @@ return /******/ (function(modules) { // webpackBootstrap
1661
1661
* a new URL onto the history stack.
1662
1662
*/
1663
1663
transitionTo : function transitionTo ( to , params , query ) {
1664
- var path = this . makePath ( to , params , query ) ;
1664
+ var path = Router . makePath ( to , params , query ) ;
1665
1665
1666
1666
if ( pendingTransition ) {
1667
1667
// Replace so pending location does not stay in history.
@@ -1676,7 +1676,7 @@ return /******/ (function(modules) { // webpackBootstrap
1676
1676
* the current URL in the history stack.
1677
1677
*/
1678
1678
replaceWith : function replaceWith ( to , params , query ) {
1679
- location . replace ( this . makePath ( to , params , query ) ) ;
1679
+ location . replace ( Router . makePath ( to , params , query ) ) ;
1680
1680
} ,
1681
1681
1682
1682
/**
@@ -1707,7 +1707,7 @@ return /******/ (function(modules) { // webpackBootstrap
1707
1707
if ( abortReason instanceof Cancellation ) {
1708
1708
return ;
1709
1709
} else if ( abortReason instanceof Redirect ) {
1710
- location . replace ( this . makePath ( abortReason . to , abortReason . params , abortReason . query ) ) ;
1710
+ location . replace ( Router . makePath ( abortReason . to , abortReason . params , abortReason . query ) ) ;
1711
1711
} else {
1712
1712
location . pop ( ) ;
1713
1713
}
@@ -1719,7 +1719,7 @@ return /******/ (function(modules) { // webpackBootstrap
1719
1719
} ,
1720
1720
1721
1721
handleLocationChange : function handleLocationChange ( change ) {
1722
- this . dispatch ( change . path , change . type ) ;
1722
+ Router . dispatch ( change . path , change . type ) ;
1723
1723
} ,
1724
1724
1725
1725
/**
@@ -1739,7 +1739,7 @@ return /******/ (function(modules) { // webpackBootstrap
1739
1739
* hooks wait, the transition is fully synchronous.
1740
1740
*/
1741
1741
dispatch : function dispatch ( path , action ) {
1742
- this . cancelPendingTransition ( ) ;
1742
+ Router . cancelPendingTransition ( ) ;
1743
1743
1744
1744
var prevPath = state . path ;
1745
1745
var isRefreshing = action == null ;
@@ -1750,9 +1750,9 @@ return /******/ (function(modules) { // webpackBootstrap
1750
1750
1751
1751
// Record the scroll position as early as possible to
1752
1752
// get it before browsers try update it automatically.
1753
- if ( prevPath && action === LocationActions . PUSH ) this . recordScrollPosition ( prevPath ) ;
1753
+ if ( prevPath && action === LocationActions . PUSH ) Router . recordScrollPosition ( prevPath ) ;
1754
1754
1755
- var match = this . match ( path ) ;
1755
+ var match = Router . match ( path ) ;
1756
1756
1757
1757
warning ( match != null , "No route matches path \"%s\". Make sure you have <Route path=\"%s\"> somewhere in your routes" , path , path ) ;
1758
1758
@@ -1780,7 +1780,7 @@ return /******/ (function(modules) { // webpackBootstrap
1780
1780
toRoutes = nextRoutes ;
1781
1781
}
1782
1782
1783
- var transition = new Transition ( path , this . replaceWith . bind ( this , path ) ) ;
1783
+ var transition = new Transition ( path , Router . replaceWith . bind ( Router , path ) ) ;
1784
1784
pendingTransition = transition ;
1785
1785
1786
1786
var fromComponents = mountedComponents . slice ( prevRoutes . length - fromRoutes . length ) ;
@@ -1809,7 +1809,7 @@ return /******/ (function(modules) { // webpackBootstrap
1809
1809
* Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation).
1810
1810
*/
1811
1811
run : function run ( callback ) {
1812
- invariant ( ! this . isRunning , "Router is already running" ) ;
1812
+ invariant ( ! Router . isRunning , "Router is already running" ) ;
1813
1813
1814
1814
dispatchHandler = function ( error , transition , newState ) {
1815
1815
if ( error ) Router . handleError ( error ) ;
@@ -1821,30 +1821,30 @@ return /******/ (function(modules) { // webpackBootstrap
1821
1821
if ( transition . abortReason ) {
1822
1822
Router . handleAbort ( transition . abortReason ) ;
1823
1823
} else {
1824
- callback . call ( this , this , nextState = newState ) ;
1824
+ callback . call ( Router , Router , nextState = newState ) ;
1825
1825
}
1826
1826
} ;
1827
1827
1828
1828
if ( ! ( location instanceof StaticLocation ) ) {
1829
- if ( location . addChangeListener ) location . addChangeListener ( Router . handleLocationChange . bind ( Router ) ) ;
1829
+ if ( location . addChangeListener ) location . addChangeListener ( Router . handleLocationChange ) ;
1830
1830
1831
- this . isRunning = true ;
1831
+ Router . isRunning = true ;
1832
1832
}
1833
1833
1834
1834
// Bootstrap using the current path.
1835
- this . refresh ( ) ;
1835
+ Router . refresh ( ) ;
1836
1836
} ,
1837
1837
1838
1838
refresh : function refresh ( ) {
1839
1839
Router . dispatch ( location . getCurrentPath ( ) , null ) ;
1840
1840
} ,
1841
1841
1842
1842
stop : function stop ( ) {
1843
- this . cancelPendingTransition ( ) ;
1843
+ Router . cancelPendingTransition ( ) ;
1844
1844
1845
- if ( location . removeChangeListener ) location . removeChangeListener ( Router . handleLocationChange . bind ( Router ) ) ;
1845
+ if ( location . removeChangeListener ) location . removeChangeListener ( Router . handleLocationChange ) ;
1846
1846
1847
- this . isRunning = false ;
1847
+ Router . isRunning = false ;
1848
1848
} ,
1849
1849
1850
1850
getLocation : function getLocation ( ) {
0 commit comments