diff --git a/page.js b/page.js index 1b9a3820..fbc639d1 100644 --- a/page.js +++ b/page.js @@ -58,6 +58,12 @@ */ var hashbang = false; + + /** + * BaseUrlInPathname option + */ + + var baseUrlInPathname = true; /** * Previous context, for capturing @@ -165,6 +171,7 @@ document.addEventListener(clickEvent, onclick, false); } if (true === options.hashbang) hashbang = true; + if (false === options.baseUrlInPathname) baseUrlInPathname = false; if (!dispatch) return; var url = (hashbang && ~location.hash.indexOf('#!')) ? location.hash.substr(2) + location.search : location.pathname + location.search + location.hash; page.replace(url, null, true, dispatch); @@ -596,7 +603,7 @@ if (hashbang) path = path.replace('#!', ''); - if (base && orig === path) return; + if (baseUrlInPathname && base && orig === path) return; e.preventDefault(); page.show(orig); @@ -1110,4 +1117,4 @@ module.exports = Array.isArray || function (arr) { }; },{}]},{},[1])(1) -}); \ No newline at end of file +});