diff options
author | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-08 10:00:10 +0100 |
---|---|---|
committer | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-08 10:00:10 +0100 |
commit | fa2f82d52f34b725483f0fd55be3cc9b04f7dc9b (patch) | |
tree | fc426d79573cf36fc4b3e975eaf36f34e3bf1a26 /theme/assets/app.js | |
parent | 58a90886daa0f12f4f25cfe1c1378f455e9eb6a9 (diff) | |
download | gitbook-fa2f82d52f34b725483f0fd55be3cc9b04f7dc9b.zip gitbook-fa2f82d52f34b725483f0fd55be3cc9b04f7dc9b.tar.gz gitbook-fa2f82d52f34b725483f0fd55be3cc9b04f7dc9b.tar.bz2 |
Tidy up use of github, and make error more descriptive
Diffstat (limited to 'theme/assets/app.js')
-rw-r--r-- | theme/assets/app.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/theme/assets/app.js b/theme/assets/app.js index f2956de..9417c84 100644 --- a/theme/assets/app.js +++ b/theme/assets/app.js @@ -21379,9 +21379,6 @@ require([ $(document).ready(function() { var $book = state.$book; - // Initialize storage - storage.setBaseKey(state.githubId); - // Init sidebar sidebar.init(); @@ -21391,12 +21388,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(); @@ -21411,5 +21413,6 @@ require([ $(".book-body").focus(); }); }); + define("app", function(){}); |