From 8d2434ac21b36552f45ffb78fc599efcb40e7e6c Mon Sep 17 00:00:00 2001 From: Brian Suh Date: Sat, 4 Oct 2014 11:59:39 -0700 Subject: [PATCH] #290 fix m.route hrefs for pathname mode --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 50479b0d..1949e13e 100644 --- a/mithril.js +++ b/mithril.js @@ -548,7 +548,7 @@ Mithril = m = new function app(window, undefined) { var context = arguments[2] if (!isInitialized) { context.href = element.getAttribute("href") - element.href = window.location.pathname + modes[m.route.mode] + context.href + element.href = (m.route.mode !== 'pathname' ? window.location.pathname : '') + modes[m.route.mode] + context.href element.removeEventListener("click", routeUnobtrusive) element.addEventListener("click", routeUnobtrusive) }