Skip to content

Commit 51579e0

Browse files
committed
Syntax tweaks
1 parent e7ab6f7 commit 51579e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/mixins/Scrolling.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ var Scrolling = {
6666
},
6767

6868
_updateScroll: function (prevState) {
69-
if (!shouldUpdateScroll(this.state, prevState)) {
69+
if (!shouldUpdateScroll(this.state, prevState))
7070
return;
71-
}
7271

7372
var scrollBehavior = this.getScrollBehavior();
7473

modules/utils/createRouter.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,18 @@ function createRouter(options) {
277277
*/
278278
dispatch: function (path, action, callback) {
279279
if (pendingTransition) {
280-
pendingTransition.abort(new Cancellation());
280+
pendingTransition.abort(new Cancellation);
281281
pendingTransition = null;
282282
}
283283

284284
var prevPath = state.path;
285285
if (prevPath === path)
286286
return; // Nothing to do!
287287

288-
if (prevPath && action !== LocationActions.REPLACE) {
288+
// Record the scroll position as early as possible to
289+
// get it before browsers try update it automatically.
290+
if (prevPath && action !== LocationActions.REPLACE)
289291
this.recordScrollPosition(prevPath);
290-
}
291292

292293
var pathname = Path.withoutQuery(path);
293294
var match = this.match(pathname);

0 commit comments

Comments
 (0)