Gaya / Gaya/queryloader2

Slow loading if no images found.

Open
#150 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
711
Forks
224
PR merge metrics
No merged PRs in 30d

Description

When the page has no images, the plugin wait for the `maxTime` to complete, instead of just completing right away.

Example:
http://jsbin.com/dureti/edit?html,output - Contains 1 image, loads pretty fast.
http://jsbin.com/henaba/edit?html,output - Has no images, takes really long time to complete.

What if we add a check after `getImageSrcs` function on https://github.com/Gaya/queryloader2/blob/183e0c0ae129300982c8e68e5eaba1f0c87c0d41/src/ImagePreloader/index.js#L29

``` js
if (this.sources.length === 0) {
this.done === true;
this.updateProgress();
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.