Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow loading if no images found. #150

Open
lcdsantos opened this issue Dec 3, 2015 · 1 comment
Open

Slow loading if no images found. #150

lcdsantos opened this issue Dec 3, 2015 · 1 comment

Comments

@lcdsantos
Copy link

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

this.sources = this.getImageSrcs(element);

if (this.sources.length === 0) {
  this.done === true;
  this.updateProgress();
}
@Gaya
Copy link
Owner

Gaya commented Dec 6, 2015

Sounds like a good plan!
You can add a pull request if you'd like to fix this problem.

lcdsantos added a commit to lcdsantos/queryloader2 that referenced this issue Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants