#304 parse querystring correctly in routed links

This commit is contained in:
Leo Horie 2014-10-12 21:48:30 -04:00
parent 0f90850b28
commit 121ed385cd

View file

@ -606,7 +606,8 @@ Mithril = m = new function app(window, undefined) {
if (e.preventDefault) e.preventDefault() if (e.preventDefault) e.preventDefault()
else e.returnValue = false else e.returnValue = false
var currentTarget = e.currentTarget || this var currentTarget = e.currentTarget || this
m.route(currentTarget[m.route.mode].slice(modes[m.route.mode].length)) var args = m.route.mode == "pathname" && currentTarget.search ? parseQueryString(currentTarget.search.slice(1)) : {}
m.route(currentTarget[m.route.mode].slice(modes[m.route.mode].length), args)
} }
function setScroll() { function setScroll() {
if (m.route.mode != "hash" && window.location.hash) window.location.hash = window.location.hash if (m.route.mode != "hash" && window.location.hash) window.location.hash = window.location.hash