From 07c183d2c263c1a765b2cd0aec2ba6ab9ed36b10 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 16 Nov 2020 01:09:59 +0100 Subject: [PATCH] Switch from jQuery pre 3.0.0 pseudo promises to ES6 promises --- qt/aqt/data/web/js/reviewer.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qt/aqt/data/web/js/reviewer.ts b/qt/aqt/data/web/js/reviewer.ts index 2dec1632c..eb3a27540 100644 --- a/qt/aqt/data/web/js/reviewer.ts +++ b/qt/aqt/data/web/js/reviewer.ts @@ -39,8 +39,7 @@ function _updateQA(html, fadeTime, onupdate, onshown) { var qa = $("#qa"); // fade out current text - qa.fadeOut(fadeTime) - .promise() + new Promise((resolve) => qa.fadeOut(fadeTime, () => resolve())) // update text .then(() => { try { @@ -66,7 +65,7 @@ function _updateQA(html, fadeTime, onupdate, onshown) { }) ) // and reveal when processing is done - .then(() => qa.fadeIn(fadeTime).promise()) + .then(() => new Promise((resolve) => qa.fadeIn(fadeTime, () => resolve()))) .then(() => _runHook(onShownHook)) .then(() => (_updatingQA = false)); }