summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-18 15:49:53 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-18 15:49:53 +0200
commitef4a8ea1b6c4dfb9a84b5c2a3c933f2d6481814e (patch)
treeabbbc784a2f0c7d8240f07cff2ec3800c802e876 /theme/javascript/core
parent49cde96ee7cf1857b4b417081a93b7d6d81b2812 (diff)
downloadgitbook-ef4a8ea1b6c4dfb9a84b5c2a3c933f2d6481814e.zip
gitbook-ef4a8ea1b6c4dfb9a84b5c2a3c933f2d6481814e.tar.gz
gitbook-ef4a8ea1b6c4dfb9a84b5c2a3c933f2d6481814e.tar.bz2
Fix #116: update url before updating html content
Diffstat (limited to 'theme/javascript/core')
-rwxr-xr-xtheme/javascript/core/navigation.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/theme/javascript/core/navigation.js b/theme/javascript/core/navigation.js
index baf53e7..1796fc1 100755
--- a/theme/javascript/core/navigation.js
+++ b/theme/javascript/core/navigation.js
@@ -25,6 +25,8 @@ define([
return $.get(url)
.done(function (html) {
+ if (push) updateHistory(url, null);
+
html = html.replace( /<(\/?)(html|head|body)([^>]*)>/ig, function(a,b,c,d){
return '<' + b + 'div' + ( b ? '' : ' data-element="' + c + '"' ) + d + '>';
});
@@ -51,8 +53,6 @@ define([
// Update state
state.update($("html"));
-
- if (push) updateHistory(url, null);
preparePage();
})
.fail(function () {