mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Decode images asynchronously
This commit is contained in:
parent
5c4d2e87a1
commit
4f5a14ed54
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,9 @@ export function allImagesLoaded(): Promise<void[]> {
|
|||
}
|
||||
|
||||
function imageLoaded(img: HTMLImageElement): Promise<void> {
|
||||
if (!img.getAttribute("decoding")) {
|
||||
img.decoding = "async";
|
||||
}
|
||||
return img.complete
|
||||
? Promise.resolve()
|
||||
: new Promise((resolve) => {
|
||||
|
|
Loading…
Reference in a new issue