Permalink
Browse files

improve JavaScript readability

  • Loading branch information...
1 parent 477f1bc commit c8e47545f455f2a3baab3a0f3fe60ead3a29a436 @fredsa fredsa committed Feb 15, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 static/js/base.js
View
@@ -350,13 +350,15 @@ google.devrel.samples.ttt.getStringsAtPositions = function(boardString, first,
google.devrel.samples.ttt.init = function(apiRoot) {
// Loads the OAuth and Tic Tac Toe APIs asynchronously, and triggers login
// when they have completed.
- var apisToLoad = 2;
+ var apisToLoad;
var callback = function() {
if (--apisToLoad == 0) {
google.devrel.samples.ttt.signin(true,
google.devrel.samples.ttt.userAuthed);
}
}
+
+ apisToLoad = 2; // must match number of calls to gapi.client.load()
gapi.client.load('tictactoe', 'v1', callback, apiRoot);
gapi.client.load('oauth2', 'v2', callback);

0 comments on commit c8e4754

Please sign in to comment.