From 71933c91de99a5ad9bb2bf978e04a7a6efed0a26 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 27 Jun 2012 22:01:27 -0600 Subject: [PATCH] prevent period timer counting up --- scoreboard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scoreboard.js b/scoreboard.js index 777eb1e..72faaf9 100644 --- a/scoreboard.js +++ b/scoreboard.js @@ -52,6 +52,7 @@ function update() { function startTimer(element, tenths, callback) { var startTime; var running = false; + var set_duration = 0; var duration = 0; var className; @@ -71,7 +72,7 @@ function startTimer(element, tenths, callback) { } // Has the timer run out? - if ((duration > 0) && (remain <= 0)) { + if ((set_duration > 0) && (remain <= 0)) { duration = 0; sec = 0; running = false; @@ -111,6 +112,7 @@ function startTimer(element, tenths, callback) { // Put element into class [cn], if set. element.set = function(t, cn) { startTime = (new Date()).getTime(); + set_duration = t; duration = t; className = cn; refresh();