fix quick red fox and make test.cancel work again

pull/1/head
ansuz 9 years ago
parent 62eabbc7ae
commit 12dcbc9121

@ -40,7 +40,7 @@ define([
var setRandomizedInterval = function (func, target, range) { var setRandomizedInterval = function (func, target, range) {
var timeout; var timeout;
var again = function () { var again = function () {
setTimeout(function () { timeout = setTimeout(function () {
again(); again();
func(); func();
}, target - (range / 2) + Math.random() * range); }, target - (range / 2) + Math.random() * range);
@ -273,13 +273,13 @@ define([
var testInput = window.testInput = function (el, offset) { var testInput = window.testInput = function (el, offset) {
var i = 0, var i = 0,
j = offset, j = offset,
input = "The quick red fox jumped over the lazy brown dog. ", input = "The quick red fox jumps over the lazy brown dog. ",
l = input.length, l = input.length,
errors = 0, errors = 0,
max_errors = 15, max_errors = 15,
interval; interval;
var cancel = function () { var cancel = function () {
//if (interval) { interval.cancel(); } if (interval) { interval.cancel(); }
}; };
interval = setRandomizedInterval(function () { interval = setRandomizedInterval(function () {

Loading…
Cancel
Save