Skip to content

Commit

Permalink
Handle the case where all avatars are already loaded at the time when…
Browse files Browse the repository at this point in the history
… the script exexecutes
  • Loading branch information
Munter committed Dec 22, 2017
1 parent 64deadc commit 123ee4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/js/avatars.js
Expand Up @@ -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;
Expand Down

0 comments on commit 123ee4f

Please sign in to comment.