summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-05-04 15:15:18 +0200
committerSamy Pessé <samypesse@gmail.com>2014-05-04 15:15:18 +0200
commitf7fe976c7e6cb6984aae0050a91cd76f77d10062 (patch)
treea98ee5fb178d4a9335ee9126b48877f5d173e8c1 /theme/javascript/core
parent756629b91d684d24ed71ff8d1323ee1c8230a47b (diff)
downloadgitbook-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')
-rwxr-xr-xtheme/javascript/core/navigation.js8
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