From 121ed385cdd8a2637ce3fbda16c33c531748276c Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Sun, 12 Oct 2014 21:48:30 -0400 Subject: [PATCH] #304 parse querystring correctly in routed links --- mithril.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index f5812eef..15844c57 100644 --- a/mithril.js +++ b/mithril.js @@ -606,7 +606,8 @@ Mithril = m = new function app(window, undefined) { if (e.preventDefault) e.preventDefault() else e.returnValue = false 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() { if (m.route.mode != "hash" && window.location.hash) window.location.hash = window.location.hash