#290 fix m.route hrefs for pathname mode

This commit is contained in:
Brian Suh 2014-10-04 11:59:39 -07:00
parent 1fa946110a
commit 8d2434ac21

View file

@ -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)
}