}
}
-function loadquickl3s()
+function loadquickl3s(sheets)
{
- var sheet_a = state['A'];
- var sheet_b = state['B'];
- var sheet_c = 'Calls';
-
var newl3s = {};
- var num_left = 3;
+ var num_left = 1;
+
+ for (var prop in sheets) {
+ if (sheets.hasOwnProperty(prop)) {
+ ++num_left;
+ }
+ }
var cb = function(response, group_name) {
for (var p in response) {
}
};
- load_l3(sheet_a, 'A', cb);
- load_l3(sheet_b, 'B', cb);
- load_l3(sheet_c, 'C', cb);
+ for (var prop in sheets) {
+ if (sheets.hasOwnProperty(prop)) {
+ load_l3(sheets[prop], prop, cb);
+ }
+ }
+ load_l3('Calls', 'C', cb);
}
// Start by loading calls only
-loadquickl3s();
+loadquickl3s({});
document.getElementById('team1').innerHTML = state['team1'];
document.getElementById('team2').innerHTML = state['team2'];
- state = { 'A': state['team1'], 'B': state['team2'] };
- loadquickl3s();
+ var sheets = { 'A': state['team1'], 'B': state['team2'] };
+ loadquickl3s(sheets);
}
function setcolors()