diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-05-04 15:15:18 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-05-04 15:15:18 +0200 |
commit | f7fe976c7e6cb6984aae0050a91cd76f77d10062 (patch) | |
tree | a98ee5fb178d4a9335ee9126b48877f5d173e8c1 /theme/javascript/core/navigation.js | |
parent | 756629b91d684d24ed71ff8d1323ee1c8230a47b (diff) | |
download | gitbook-f7fe976c7e6cb6984aae0050a91cd76f77d10062.zip gitbook-f7fe976c7e6cb6984aae0050a91cd76f77d10062.tar.gz gitbook-f7fe976c7e6cb6984aae0050a91cd76f77d10062.tar.bz2 |
Fix #197: use URI.js for calculation of relative url
Use bower for client dependencies
Diffstat (limited to 'theme/javascript/core/navigation.js')
-rwxr-xr-x | theme/javascript/core/navigation.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/theme/javascript/core/navigation.js b/theme/javascript/core/navigation.js index 7eac392..e2bc60c 100755 --- a/theme/javascript/core/navigation.js +++ b/theme/javascript/core/navigation.js @@ -1,6 +1,6 @@ define([ "jQuery", - "utils/path", + "utils/url", "core/events", "core/state", "core/search", @@ -8,15 +8,15 @@ define([ "core/exercise", "core/quiz", "core/loading" -], function($, path, events, state, search, progress, exercises, quiz, loading) { +], function($, URL, events, state, search, progress, exercises, quiz, loading) { var prev, next; var githubCountStars, githubCountWatch; var usePushState = (typeof history.pushState !== "undefined"); var handleNavigation = function(relativeUrl, push) { - var url = path.isAbsolute(relativeUrl) ? relativeUrl : path.join(path.dirname(window.location.pathname), relativeUrl); - console.log("navigate to ", url, "baseurl="+relativeUrl); + var url = URL.join(window.location.pathname, relativeUrl); + console.log("navigate to ", url, "baseurl="+relativeUrl, "current="+window.location.pathname); if (!usePushState) { // Refresh the page to the new URL if pushState not supported |