Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
improve JavaScript readability
Browse files Browse the repository at this point in the history
  • Loading branch information
fredsa committed Feb 15, 2013
1 parent 477f1bc commit c8e4754
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/js/base.js
Expand Up @@ -350,13 +350,15 @@ google.devrel.samples.ttt.getStringsAtPositions = function(boardString, first,
google.devrel.samples.ttt.init = function(apiRoot) { google.devrel.samples.ttt.init = function(apiRoot) {
// Loads the OAuth and Tic Tac Toe APIs asynchronously, and triggers login // Loads the OAuth and Tic Tac Toe APIs asynchronously, and triggers login
// when they have completed. // when they have completed.
var apisToLoad = 2; var apisToLoad;
var callback = function() { var callback = function() {
if (--apisToLoad == 0) { if (--apisToLoad == 0) {
google.devrel.samples.ttt.signin(true, google.devrel.samples.ttt.signin(true,
google.devrel.samples.ttt.userAuthed); 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('tictactoe', 'v1', callback, apiRoot);
gapi.client.load('oauth2', 'v2', callback); gapi.client.load('oauth2', 'v2', callback);


Expand Down

0 comments on commit c8e4754

Please sign in to comment.