@symbo.ls/router 2.12.24 → 2.12.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -10,6 +10,12 @@ export const getActiveRoute = (level = 0, route = window.location.pathname) => {
|
|
|
10
10
|
if (activeRoute) return `/${activeRoute}`
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
export const getActiveRouteLastPath = (route = window.location.pathname) => {
|
|
14
|
+
const routeArray = route.split('/')
|
|
15
|
+
const activeRoute = routeArray[routeArray.length - 1]
|
|
16
|
+
if (activeRoute) return `/${activeRoute}`
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
export let lastPathname
|
|
14
20
|
export let lastLevel = 0
|
|
15
21
|
|
|
@@ -70,7 +76,7 @@ export const router = (
|
|
|
70
76
|
|
|
71
77
|
if (!content) return
|
|
72
78
|
if (options.pushState) {
|
|
73
|
-
window.history.pushState({ prevUrl: window.location.href, ...state}, null, route + (hash ? `#${hash}` : ''))
|
|
79
|
+
window.history.pushState({ prevUrl: window.location.href, ...state }, null, route + (hash ? `#${hash}` : ''))
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
const isModal = checkRouteModal(pathname, element)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/router",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.38",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"@domql/utils": "latest",
|
|
12
12
|
"@symbo.ls/auth-redirect": "latest"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "c2d209beb1fb834de716d09ebaa50376108931be",
|
|
15
15
|
"source": "index.js"
|
|
16
16
|
}
|