mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
Merge pull request #300 from nextjournal/html5-hist-fragments
Pass uri fragments to history pushState
This commit is contained in:
commit
99ea1ef091
1 changed files with 4 additions and 2 deletions
|
|
@ -109,8 +109,10 @@
|
||||||
(when (ignore-anchor-click-predicate router e el uri)
|
(when (ignore-anchor-click-predicate router e el uri)
|
||||||
(.preventDefault e)
|
(.preventDefault e)
|
||||||
(let [path (str (.getPath uri)
|
(let [path (str (.getPath uri)
|
||||||
(if (seq (.getQuery uri))
|
(when (.hasQuery uri)
|
||||||
(str "?" (.getQuery uri))))]
|
(str "?" (.getQuery uri)))
|
||||||
|
(when (.hasFragment uri)
|
||||||
|
(str "#" (.getFragment uri))))]
|
||||||
(.pushState js/window.history nil "" path)
|
(.pushState js/window.history nil "" path)
|
||||||
(-on-navigate this path))))))]
|
(-on-navigate this path))))))]
|
||||||
(-on-navigate this (-get-path this))
|
(-on-navigate this (-get-path this))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue