summaryrefslogtreecommitdiffstats
path: root/theme/javascript/state.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/state.js')
-rw-r--r--theme/javascript/state.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/theme/javascript/state.js b/theme/javascript/state.js
index 68fafea..5fde20f 100644
--- a/theme/javascript/state.js
+++ b/theme/javascript/state.js
@@ -11,9 +11,13 @@ state.update = function(dom) {
state.level = $book.data('level');
state.basePath = $book.data('basepath');
state.revision = $book.data('revision');
+ state.filepath = $book.data('filepath');
// Absolute url to the root of the book
- state.root = url.resolve(location.origin, path.dirname(path.resolve(location.pathname, state.basePath)));
+ state.root = url.resolve(
+ location.protocol+'//'+location.host,
+ path.dirname(path.resolve(location.pathname, state.basePath))
+ );
};
state.update($);