Skip to content

Slow loading if no images found. #150

@lcdsantos

Description

@lcdsantos

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();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions