Skip to content

Commit 2acbeb1

Browse files
committed
[build] 2.2.1
1 parent b6f96e9 commit 2acbeb1

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

dist/vue-router.common.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.2.0
2+
* vue-router v2.2.1
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -1380,12 +1380,11 @@ var positionStore = Object.create(null);
13801380

13811381
function setupScroll () {
13821382
window.addEventListener('popstate', function (e) {
1383+
saveScrollPosition();
13831384
if (e.state && e.state.key) {
13841385
setStateKey(e.state.key);
13851386
}
13861387
});
1387-
1388-
window.addEventListener('scroll', saveScrollPosition);
13891388
}
13901389

13911390
function handleScroll (
@@ -1510,6 +1509,7 @@ function setStateKey (key) {
15101509
}
15111510

15121511
function pushState (url, replace) {
1512+
saveScrollPosition();
15131513
// try...catch the pushState call to get around Safari
15141514
// DOM Exception 18 where it limits to 100 pushState calls
15151515
var history = window.history;
@@ -1520,7 +1520,6 @@ function pushState (url, replace) {
15201520
_key = genKey();
15211521
history.pushState({ key: _key }, '', url);
15221522
}
1523-
saveScrollPosition();
15241523
} catch (e) {
15251524
window.location[replace ? 'replace' : 'assign'](url);
15261525
}
@@ -2270,7 +2269,7 @@ function createHref (base, fullPath, mode) {
22702269
}
22712270

22722271
VueRouter.install = install;
2273-
VueRouter.version = '2.2.0';
2272+
VueRouter.version = '2.2.1';
22742273

22752274
if (inBrowser && window.Vue) {
22762275
window.Vue.use(VueRouter);

dist/vue-router.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* vue-router v2.2.0
2+
* vue-router v2.2.1
33
* (c) 2017 Evan You
44
* @license MIT
55
*/
@@ -1384,12 +1384,11 @@ var positionStore = Object.create(null);
13841384

13851385
function setupScroll () {
13861386
window.addEventListener('popstate', function (e) {
1387+
saveScrollPosition();
13871388
if (e.state && e.state.key) {
13881389
setStateKey(e.state.key);
13891390
}
13901391
});
1391-
1392-
window.addEventListener('scroll', saveScrollPosition);
13931392
}
13941393

13951394
function handleScroll (
@@ -1514,6 +1513,7 @@ function setStateKey (key) {
15141513
}
15151514

15161515
function pushState (url, replace) {
1516+
saveScrollPosition();
15171517
// try...catch the pushState call to get around Safari
15181518
// DOM Exception 18 where it limits to 100 pushState calls
15191519
var history = window.history;
@@ -1524,7 +1524,6 @@ function pushState (url, replace) {
15241524
_key = genKey();
15251525
history.pushState({ key: _key }, '', url);
15261526
}
1527-
saveScrollPosition();
15281527
} catch (e) {
15291528
window.location[replace ? 'replace' : 'assign'](url);
15301529
}
@@ -2274,7 +2273,7 @@ function createHref (base, fullPath, mode) {
22742273
}
22752274

22762275
VueRouter.install = install;
2277-
VueRouter.version = '2.2.0';
2276+
VueRouter.version = '2.2.1';
22782277

22792278
if (inBrowser && window.Vue) {
22802279
window.Vue.use(VueRouter);

0 commit comments

Comments
 (0)