mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Switch from jQuery pre 3.0.0 pseudo promises to ES6 promises
This commit is contained in:
parent
435ecc3ae8
commit
07c183d2c2
1 changed files with 2 additions and 3 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue