diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-18 15:49:53 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-18 15:49:53 +0200 |
commit | ef4a8ea1b6c4dfb9a84b5c2a3c933f2d6481814e (patch) | |
tree | abbbc784a2f0c7d8240f07cff2ec3800c802e876 /theme/javascript/core | |
parent | 49cde96ee7cf1857b4b417081a93b7d6d81b2812 (diff) | |
download | gitbook-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-x | theme/javascript/core/navigation.js | 4 |
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 () { |