minor fixes
This commit is contained in:
parent
15f7acfc2a
commit
4541b7af75
4 changed files with 11 additions and 23 deletions
|
@ -45,7 +45,7 @@
|
|||
function clockStart() {
|
||||
// set a new interval only if the clock is stopped
|
||||
// otherwise we would rewrite the timerID reference to the running interval and wouldn't be able to stop the clock ever again
|
||||
if (!timerId) {
|
||||
if (!timerId) {
|
||||
timerId = setInterval(update, 1000);
|
||||
}
|
||||
update(); // <-- start right now, don't wait 1 second till the first setInterval works
|
||||
|
@ -56,7 +56,6 @@
|
|||
timerId = null; // <-- clear timerID to indicate that the clock has been stopped, so that it is possible to start it again in clockStart()
|
||||
}
|
||||
|
||||
clockStart();
|
||||
</script>
|
||||
|
||||
<!-- click on this button calls clockStart() -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue