diff --git a/lib/index.js b/lib/index.js index e5e9021..c6cb373 100644 --- a/lib/index.js +++ b/lib/index.js @@ -150,13 +150,13 @@ function click(e) { || el.href.indexOf(loc.href.match(RE_ORIGIN)[0]) == -1 // cross origin ) return - if (el.href != loc.href) { - if ( + if (el.href != loc.href + && ( el.href.split('#')[0] == loc.href.split('#')[0] // internal jump - || base != '#' && getPathFromRoot(el.href).indexOf(base) !== 0 // outside of base + || base[0] != '#' && getPathFromRoot(el.href).indexOf(base) !== 0 // outside of base + || base[0] == '#' && el.href.split(base)[0] != loc.href.split(base)[0] // outside of #base || !go(getPathFromBase(el.href), el.title || doc.title) // route not found - ) return - } + )) return e.preventDefault() }