Skip to content

Commit

Permalink
Merge branch 'master' into remove-route-store
Browse files Browse the repository at this point in the history
Conflicts:
	modules/actions/LocationActions.js
	modules/components/Routes.js
	modules/locations/HistoryLocation.js
	modules/locations/MemoryLocation.js
	modules/mixins/PathListener.js
	modules/stores/PathStore.js
	modules/utils/makeHref.js
  • Loading branch information
mjackson committed Sep 29, 2014
2 parents f2bf4bd + 4e90bbe commit f0d599a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions modules/mixins/ActiveDelegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/mixins/TransitionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 5 additions & 2 deletions modules/stores/PathStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
})

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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": {
Expand All @@ -61,4 +61,4 @@
"browserify-shim": {
"react": "global:React"
}
}
}
13 changes: 8 additions & 5 deletions specs/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit f0d599a

Please sign in to comment.