Frerit / epiclock

Automatically exported from code.google.com/p/epiclock
0 stars 0 forks source link

EC_STOPWATCH not tearing #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There seems to be a problem with mode: EC_STOPWATCH. According to your
documentation the timer should "tear" away when paused, and continue
counting when resumed. I'm experiencing the opposite, that the clock
continues to count in the background while the digits are frozen. The clock
also seems to start counting once I instantiate it, instead of when I call
.clocks() for the first time. Please see the code example below, or the
attached .rar'ed file that also contains the .js files I'm using. I've
tried both jQuery 1.3 and 1.4, in addition to various versions of epiClock
from 2.1.2 and up.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Countdown</title>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="jquery.epiclock.js"></script>
        <script type="text/javascript">
            var running = false;
            $(function() {

                $("#clock").epiclock({mode: EC_STOPWATCH});
                    $("#button").click(function(){

                    if (running) {
                        $("#clock").clocks(EC_HALT);

                    } else {
                        $("#clock").clocks();

                    }

                    running = !running;

                });
            });
        </script>
    </head>
    <body>
            <span id="clock"></span>

            <span id="button">START/STOP</span>
    </body>
</html>

Original issue reported on code.google.com by christia...@gmail.com on 19 Jan 2010 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the perfect bug report. :)

I managed to find the problem. For whatever reason when I rewrote the script 
for jQuery, I believe the stopwatch 
never worked, as the jQuery.epiclock(EC_*) calls were not being provided to the 
elements through their 
jQuery('#element').epiclock() calls. I updated the source a bit and released 
2.2.2 which should now properly tear 
stopwatches on pause, and properly start the stopwatch from the first 
EC_RUN/resume call made to the clock.

Original comment by gars...@gmail.com on 19 Jan 2010 at 10:43

GoogleCodeExporter commented 9 years ago

Original comment by gars...@gmail.com on 19 Jan 2010 at 10:43