Skip to content

Commit f0d599a

Browse files
committed
Merge branch 'master' into remove-route-store
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
2 parents f2bf4bd + 4e90bbe commit f0d599a

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ In order to try out the examples, you need to follow these steps:
55
1. Clone this repo
66
1. Run `npm -g install webpack`, if you don't have it installed already
77
1. Run `npm install` from the repo's root directory
8-
1. Run `./script/build-examples` from the repo's root directory
8+
1. Run `./scripts/build-examples` from the repo's root directory
99
1. Point your browser to the `index.html` location in this directory

modules/mixins/ActiveDelegate.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ function routeIsActive(activeRoutes, routeName) {
88
}
99

1010
function paramsAreActive(activeParams, params) {
11-
for (var property in params) {
12-
if (activeParams[property] != params[property])
11+
for (var property in params)
12+
if (String(activeParams[property]) !== String(params[property]))
1313
return false;
14-
}
1514

1615
return true;
1716
}
1817

1918
function queryIsActive(activeQuery, query) {
20-
for (var property in query) {
21-
if (activeQuery[property] != query[property])
19+
for (var property in query)
20+
if (String(activeQuery[property]) !== String(query[property]))
2221
return false;
23-
}
2422

2523
return true;
2624
}

modules/mixins/TransitionHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function computeNextState(component, transition, callback) {
127127
if (error || transition.isAborted)
128128
return callback(error);
129129

130-
var matches = currentMatches.slice(0, -fromMatches.length).concat(toMatches);
130+
var matches = currentMatches.slice(0, currentMatches.length - fromMatches.length).concat(toMatches);
131131
var rootMatch = getRootMatch(matches);
132132
var params = (rootMatch && rootMatch.params) || {};
133133
var routes = matches.map(function (match) {

modules/stores/PathStore.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ var PathStore = {
3939
case LocationActions.PUSH:
4040
case LocationActions.REPLACE:
4141
case LocationActions.POP:
42-
_currentPath = action.path;
43-
notifyChange(action.sender);
42+
if (_currentPath !== action.path) {
43+
_currentPath = action.path;
44+
notifyChange(action.sender);
45+
}
46+
break;
4447
}
4548
})
4649

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "https://github.com/rackt/react-router.git"
99
},
10-
"homepage": "https://github.com/rackt/react-router",
10+
"homepage": "https://github.com/rackt/react-router/blob/latest/README.md",
1111
"bugs": "https://github.com/rackt/react-router/issues",
1212
"directories": {
1313
"example": "examples"
@@ -34,7 +34,7 @@
3434
"mocha": "1.20.1",
3535
"react": ">=0.11.0",
3636
"reactify": "^0.14.0",
37-
"rf-release": "0.3.1",
37+
"rf-release": "0.3.2",
3838
"uglify-js": "2.4.15"
3939
},
4040
"peerDependencies": {
@@ -61,4 +61,4 @@
6161
"browserify-shim": {
6262
"react": "global:React"
6363
}
64-
}
64+
}

specs/helper.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ beforeEach(function () {
1313
RouteStore.unregisterAllRoutes();
1414
});
1515

16-
var transitionTo = require('../modules/actions/LocationActions').transitionTo;
1716
var MemoryLocation = require('../modules/locations/MemoryLocation');
18-
var PathStore = require('../modules/stores/PathStore');
17+
var ScrollToTopStrategy = require('../modules/strategies/ScrollToTopStrategy');
18+
var LocationActions = require('../modules/actions/LocationActions');
19+
var ScrollStore = require('../modules/stores/ScrollStore');
1920

2021
beforeEach(function () {
21-
PathStore.setup(MemoryLocation);
22-
transitionTo('/');
22+
ScrollStore.setup(ScrollToTopStrategy);
23+
LocationActions.setup(MemoryLocation);
24+
LocationActions.transitionTo('/');
2325
});
2426

2527
afterEach(function () {
26-
PathStore.teardown();
28+
ScrollStore.teardown();
29+
LocationActions.teardown();
2730
});

0 commit comments

Comments
 (0)