Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Handle the case where all avatars are already loaded at the time when the script exexecutes

Peter Müller123ee4f42388
diff --git a/docs/js/avatars.js b/docs/js/avatars.js
index 3c609847..7706fa1e 100644
--- a/docs/js/avatars.js
+++ b/docs/js/avatars.js
@@ -18,6 +18,10 @@
for (var i = 0; i < images.length; i += 1) {
if (images[i].complete) {
counter -= 1;
+
+ if (counter === 0) {
+ imageList.classList.add('is-loaded');
+ }
} else {
images[i].onload = onloadHandler;
images[i].onerror = onloadHandler;