From e6d7e203e773c96f62ad3543fbfd684737e74407 Mon Sep 17 00:00:00 2001 From: hikariatama Date: Thu, 22 Sep 2022 10:52:51 +0000 Subject: [PATCH] change animation playback function --- web-resources/static/root.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/web-resources/static/root.js b/web-resources/static/root.js index 0e897cc..499f99a 100644 --- a/web-resources/static/root.js +++ b/web-resources/static/root.js @@ -117,7 +117,7 @@ function tg_code() { if (response.status == 401) { $(".auth-code-form").hide().fadeIn(300, () => { $("#monkey-close").html(); - anim = bodymovin.loadAnimation({ + bodymovin.loadAnimation({ container: document.getElementById("monkey-close"), renderer: "canvas", loop: false, @@ -127,11 +127,6 @@ function tg_code() { clearCanvas: true, } }); - anim.addEventListener("complete", function () { - setTimeout(function () { - anim.goToAndPlay(0); - }, 2000); - }) }); $(".code-input").removeAttr("disabled"); $(".code-caption").html("Enter your Telegram 2FA password, then press Enter"); @@ -272,7 +267,7 @@ function process_next() { } else { $(".auth-code-form").hide().fadeIn(300, () => { $("#monkey").html(); - anim2 = bodymovin.loadAnimation({ + anim = bodymovin.loadAnimation({ container: document.getElementById("monkey"), renderer: "canvas", loop: false, @@ -282,9 +277,9 @@ function process_next() { clearCanvas: true, } }); - anim2.addEventListener("complete", function () { + anim.addEventListener("complete", function () { setTimeout(function () { - anim2.goToAndPlay(0); + anim.goToAndPlay(0); }, 2000); }) });