mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 16:31: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)
|
||||
(.preventDefault e)
|
||||
(let [path (str (.getPath uri)
|
||||
(if (seq (.getQuery uri))
|
||||
(str "?" (.getQuery uri))))]
|
||||
(when (.hasQuery uri)
|
||||
(str "?" (.getQuery uri)))
|
||||
(when (.hasFragment uri)
|
||||
(str "#" (.getFragment uri))))]
|
||||
(.pushState js/window.history nil "" path)
|
||||
(-on-navigate this path))))))]
|
||||
(-on-navigate this (-get-path this))
|
||||
|
|
|
|||
Loading…
Reference in a new issue