Skip to content

Commit 7ed6933

Browse files
committed
provide history state to history push/replace
1 parent c8db196 commit 7ed6933

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

modules/mixins/utils.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ const updateHash = (hash, historyUpdate) => {
66
? curLoc.pathname + curLoc.search + hashToUpdate
77
: curLoc.pathname + curLoc.search;
88
historyUpdate
9-
? history.pushState(null, "", urlToPush)
10-
: history.replaceState(null, "", urlToPush);
9+
? history.pushState(history.state, "", urlToPush)
10+
: history.replaceState(history.state, "", urlToPush);
11+
1112
};
1213

1314
const getHash = () => {
@@ -39,8 +40,8 @@ const scrollOffset = (c, t, horizontal) => {
3940
return c === document
4041
? t.getBoundingClientRect().left + (window.scrollX || window.pageXOffset)
4142
: getComputedStyle(c).position !== "static"
42-
? t.offsetLeft
43-
: t.offsetLeft - c.offsetLeft;
43+
? t.offsetLeft
44+
: t.offsetLeft - c.offsetLeft;
4445
} else {
4546
if (c === document) {
4647
return (

package-lock.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)