Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions toad.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@

for (; j < len; ++j) {
this_el = elements[j];
if (!this_el.getAttribute('data-src') || !isInViewport(this_el.getBoundingClientRect())) {
return;

if (!this_el.getAttribute('data-src') || this_el.getAttribute('data-src') === '' || !isInViewport(this_el.getBoundingClientRect())) {
continue;
}

if (!!this_el.getAttribute('data-src') && isInViewport(this_el.getBoundingClientRect())) {
Expand Down
8 changes: 4 additions & 4 deletions toad.next.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}

function rebounce (f) {
var scheduled, context, args, i, j;
let scheduled, context, args, i, j;

return function () {
context = this;
args = [];
Expand Down Expand Up @@ -44,8 +44,8 @@
for (;j < i; ++j) {
let this_el = elements[j];

if (!this_el.getAttribute('data-src') || !isInViewport(this_el.getBoundingClientRect())) {
return;
if (!this_el.getAttribute('data-src') || this_el.getAttribute('data-src') === '' || !isInViewport(this_el.getBoundingClientRect())) {
continue;
}

if (!!this_el.getAttribute('data-src') && isInViewport(this_el.getBoundingClientRect())) {
Expand Down