#1342 update m.route.link target if href changes

This commit is contained in:
Leo Horie 2016-10-04 12:19:55 -04:00
parent 0e918f14c2
commit 40251c6c16
7 changed files with 153 additions and 44 deletions

View file

@ -1123,7 +1123,9 @@ var coreRouter = function($window) {
vnode2.dom.onclick = function(e) {
e.preventDefault()
e.redraw = false
setPath(vnode2.attrs.href, undefined, undefined)
var href = this.getAttribute("href")
if (href.indexOf(prefix1) === 0) href = href.slice(prefix1.length)
setPath(href, undefined, undefined)
}
}
return {setPrefix: setPrefix, getPath: getPath, setPath: setPath, defineRoutes: defineRoutes, link: link}