From 9ea75c66b459f5772787943aecc874164d79ccd5 Mon Sep 17 00:00:00 2001 From: 7diac Date: Thu, 6 Mar 2014 16:23:37 +0100 Subject: [PATCH] Stop it all only if both d, h and m are zero Checking only this.stopTime.d will cause the counter stops if just the days left are 0, although hours and/or minutes are not 0. --- Source/SimpleCounter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/SimpleCounter.js b/Source/SimpleCounter.js index 216452a..b4d4cf8 100644 --- a/Source/SimpleCounter.js +++ b/Source/SimpleCounter.js @@ -201,7 +201,8 @@ var SimpleCounter = new Class({ decrementTime : function(){ this.time.s--; if (this.time.s<0){ - this.time.s = this.stopTime.d ? 0 : 59; + //Stop it all if d, h and m are zero + this.time.s = this.stopTime.d && this.stopTime.h && this.stopTime.m ? 0 : 59; if (!this.stopTime.s && this.time.s === 0 ) this.stopTime.s = true; else this.time.m--;