Replace clearTimeout by clearInterval, otherwise we could end up drawing the page in an infinite loop
This commit is contained in:
parent
a705db84b0
commit
741191e372
5
test.js
5
test.js
@ -50,8 +50,7 @@ function gotoPage(num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function displayPage(num) {
|
function displayPage(num) {
|
||||||
if (pageNum != num)
|
window.clearInterval(pageInterval);
|
||||||
window.clearTimeout(pageInterval);
|
|
||||||
|
|
||||||
document.getElementById("pageNumber").value = num;
|
document.getElementById("pageNumber").value = num;
|
||||||
|
|
||||||
@ -94,7 +93,7 @@ function displayPage(num) {
|
|||||||
if (Fonts[font.name].loading)
|
if (Fonts[font.name].loading)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearInterval(pageInterval);
|
window.clearInterval(pageInterval);
|
||||||
|
|
||||||
var t3 = Date.now();
|
var t3 = Date.now();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user