Skip to content

Commit

Permalink
fix(router): initial url in somecase (#4122)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo930021 authored Jan 16, 2023
1 parent 2d17f7a commit fe800cf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/modules/router/router-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ class Router extends Framework7Class {
if (navEl.isSliding) {
if (navEl.isSubnavbar && oldIsLarge) {
$el.transform(
`translate3d(${
offset * progress
`translate3d(${offset * progress
}px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)`,
);
} else {
Expand Down Expand Up @@ -1180,11 +1179,15 @@ class Router extends Framework7Class {
}
} else {
if (browserHistoryRoot && documentUrl.indexOf(browserHistoryRoot) >= 0) {
documentUrl = documentUrl.split(browserHistoryRoot)[1];
documentUrl = documentUrl.substring(
documentUrl.indexOf(browserHistoryRoot) + browserHistoryRoot.length,
);
if (documentUrl === '') documentUrl = '/';
}
if (browserHistorySeparator.length > 0 && documentUrl.indexOf(browserHistorySeparator) >= 0) {
initialUrl = documentUrl.split(browserHistorySeparator)[1];
initialUrl = documentUrl.substring(
documentUrl.indexOf(browserHistorySeparator) + browserHistorySeparator.length,
);
} else {
initialUrl = documentUrl;
}
Expand Down

0 comments on commit fe800cf

Please sign in to comment.