From 447e837b1733d11cd6111a26aaf1ba81fd303251 Mon Sep 17 00:00:00 2001 From: Patrick Fairbank Date: Wed, 20 Aug 2014 23:54:58 -0700 Subject: [PATCH] Fixed scheduling UI bug. --- static/js/setup_schedule.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/setup_schedule.js b/static/js/setup_schedule.js index 31575ea..5f77280 100644 --- a/static/js/setup_schedule.js +++ b/static/js/setup_schedule.js @@ -36,6 +36,10 @@ var updateBlock = function(blockNumber) { $("#numMatches" + blockNumber).text(numMatches); $("#actualEndTime" + blockNumber).text(actualEndTime); + updateStats(); +} + +var updateStats = function() { // Update total number of matches. var totalNumMatches = 0; $.each(blockMatches, function(k, v) { @@ -48,13 +52,13 @@ var updateBlock = function(blockNumber) { $("#matchesPerTeam").text(matchesPerTeam); $("#numExcessMatches").text(numExcessMatches); $("#nextLevelMatches").text(nextLevelMatches); -} +}; var deleteBlock = function(blockNumber) { delete blockMatches[blockNumber]; $("#block" + blockNumber).remove(); - updateBlock(blockNumber); -} + updateStats(); +}; // Dynamically generates and posts a form containing the schedule blocks to the server for population. var generateSchedule = function() {