diff --git a/examples/README.md b/examples/README.md index 8f0989f6b6..05d0c59575 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,5 +5,5 @@ In order to try out the examples, you need to follow these steps: 1. Clone this repo 1. Run `npm -g install webpack`, if you don't have it installed already 1. Run `npm install` from the repo's root directory -1. Run `./script/build-examples` from the repo's root directory +1. Run `./scripts/build-examples` from the repo's root directory 1. Point your browser to the `index.html` location in this directory diff --git a/modules/mixins/ActiveDelegate.js b/modules/mixins/ActiveDelegate.js index d8036efa46..a3c071b681 100644 --- a/modules/mixins/ActiveDelegate.js +++ b/modules/mixins/ActiveDelegate.js @@ -8,19 +8,17 @@ function routeIsActive(activeRoutes, routeName) { } function paramsAreActive(activeParams, params) { - for (var property in params) { - if (activeParams[property] != params[property]) + for (var property in params) + if (String(activeParams[property]) !== String(params[property])) return false; - } return true; } function queryIsActive(activeQuery, query) { - for (var property in query) { - if (activeQuery[property] != query[property]) + for (var property in query) + if (String(activeQuery[property]) !== String(query[property])) return false; - } return true; } diff --git a/modules/mixins/TransitionHandler.js b/modules/mixins/TransitionHandler.js index 4514d9cc5e..1c9d134f64 100644 --- a/modules/mixins/TransitionHandler.js +++ b/modules/mixins/TransitionHandler.js @@ -127,7 +127,7 @@ function computeNextState(component, transition, callback) { if (error || transition.isAborted) return callback(error); - var matches = currentMatches.slice(0, -fromMatches.length).concat(toMatches); + var matches = currentMatches.slice(0, currentMatches.length - fromMatches.length).concat(toMatches); var rootMatch = getRootMatch(matches); var params = (rootMatch && rootMatch.params) || {}; var routes = matches.map(function (match) { diff --git a/modules/stores/PathStore.js b/modules/stores/PathStore.js index c5f502a9bb..d4e93e95fb 100644 --- a/modules/stores/PathStore.js +++ b/modules/stores/PathStore.js @@ -39,8 +39,11 @@ var PathStore = { case LocationActions.PUSH: case LocationActions.REPLACE: case LocationActions.POP: - _currentPath = action.path; - notifyChange(action.sender); + if (_currentPath !== action.path) { + _currentPath = action.path; + notifyChange(action.sender); + } + break; } }) diff --git a/package.json b/package.json index 0ccb973a11..60a9e3d563 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "https://github.com/rackt/react-router.git" }, - "homepage": "https://github.com/rackt/react-router", + "homepage": "https://github.com/rackt/react-router/blob/latest/README.md", "bugs": "https://github.com/rackt/react-router/issues", "directories": { "example": "examples" @@ -34,7 +34,7 @@ "mocha": "1.20.1", "react": ">=0.11.0", "reactify": "^0.14.0", - "rf-release": "0.3.1", + "rf-release": "0.3.2", "uglify-js": "2.4.15" }, "peerDependencies": { @@ -61,4 +61,4 @@ "browserify-shim": { "react": "global:React" } -} \ No newline at end of file +} diff --git a/specs/helper.js b/specs/helper.js index d27ae13320..6b35efd789 100644 --- a/specs/helper.js +++ b/specs/helper.js @@ -13,15 +13,18 @@ beforeEach(function () { RouteStore.unregisterAllRoutes(); }); -var transitionTo = require('../modules/actions/LocationActions').transitionTo; var MemoryLocation = require('../modules/locations/MemoryLocation'); -var PathStore = require('../modules/stores/PathStore'); +var ScrollToTopStrategy = require('../modules/strategies/ScrollToTopStrategy'); +var LocationActions = require('../modules/actions/LocationActions'); +var ScrollStore = require('../modules/stores/ScrollStore'); beforeEach(function () { - PathStore.setup(MemoryLocation); - transitionTo('/'); + ScrollStore.setup(ScrollToTopStrategy); + LocationActions.setup(MemoryLocation); + LocationActions.transitionTo('/'); }); afterEach(function () { - PathStore.teardown(); + ScrollStore.teardown(); + LocationActions.teardown(); });