diff options
| -rw-r--r-- | emcclib.js | 12 | ||||
| -rw-r--r-- | emccpre.js | 1 |
2 files changed, 7 insertions, 6 deletions
@@ -200,16 +200,16 @@ mergeInto(LibraryManager.library, { if (!timer_active) { timer_reference = performance.now(); var frame = function(now) { - current_timer = null; + timer = null; timer_callback((now - timer_reference) / 1000.0); /* The callback may have deactivated the timer. */ if (timer_active) { timer_reference = now; - current_timer = window.requestAnimationFrame(frame); + timer = window.requestAnimationFrame(frame); } } timer_active = true; - current_timer = window.requestAnimationFrame(frame); + timer = window.requestAnimationFrame(frame); } }, @@ -221,9 +221,9 @@ mergeInto(LibraryManager.library, { js_deactivate_timer: function() { if (timer_active) { timer_active = false; - if (current_timer !== null) { - window.cancelAnimationFrame(current_timer); - current_timer = null; + if (timer !== null) { + window.cancelAnimationFrame(timer); + timer = null; } } }, @@ -90,6 +90,7 @@ var midpoint_test_str = "ABCDEFGHIKLMNOPRSTUVWXYZ0123456789"; var midpoint_cache = []; // Variables used by js_activate_timer() and js_deactivate_timer(). +var timer = null; var timer_active = false; var timer_reference; |