diff options
author | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:51:41 +0100 |
---|---|---|
committer | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:51:41 +0100 |
commit | 58a90886daa0f12f4f25cfe1c1378f455e9eb6a9 (patch) | |
tree | 9207b2f93952b95ddd0f551af855390a9020e2c1 /theme/javascript/app.js | |
parent | 80794997a4ebfc5bf397132ff89ee8c76e99efbe (diff) | |
download | gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.zip gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.tar.gz gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.tar.bz2 |
Whoops, missed a couple of extra uses of githubId
Diffstat (limited to 'theme/javascript/app.js')
-rw-r--r-- | theme/javascript/app.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/theme/javascript/app.js b/theme/javascript/app.js index 34247ca..392d45b 100644 --- a/theme/javascript/app.js +++ b/theme/javascript/app.js @@ -14,9 +14,6 @@ require([ $(document).ready(function() { var $book = state.$book; - // Initialize storage - storage.setBaseKey(state.githubId); - // Init sidebar sidebar.init(); @@ -26,12 +23,17 @@ require([ // Init keyboard keyboard.init(); - // Star and watch count - $.getJSON("https://api.github.com/repos/"+state.githubId) - .done(function(repo) { - $book.find(".count-star span").text(repo.stargazers_count); - $book.find(".count-watch span").text(repo.subscribers_count); - }); + if (state.githubId) { + // Initialize storage + storage.setBaseKey(state.githubId); + + // Star and watch count + $.getJSON("https://api.github.com/repos/"+state.githubId) + .done(function(repo) { + $book.find(".count-star span").text(repo.stargazers_count); + $book.find(".count-watch span").text(repo.subscribers_count); + }); + } // Bind exercise exercise.init(); @@ -45,4 +47,4 @@ require([ // Focus on content $(".book-body").focus(); }); -});
\ No newline at end of file +}); |