Skip to content

Commit

Permalink
Added thumbnail callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Bergehall committed Feb 22, 2017
1 parent 2f96118 commit c3aa3cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/lazyframe.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/lazyframe.js
Expand Up @@ -18,7 +18,8 @@ const Lazyframe = () => {
lazyload: true,
initinview: false,
onLoad: (l) => {},
onAppend: (l) => {}
onAppend: (l) => {},
onThumbnailLoad: (img) => {}
};

const constants = {
Expand Down Expand Up @@ -188,7 +189,9 @@ const Lazyframe = () => {
_l.settings.title = constants.response[_l.settings.vendor].title(response);
}
if (!_l.settings.thumbnail) {
_l.settings.thumbnail = constants.response[_l.settings.vendor].thumbnail(response);
const url = constants.response[_l.settings.vendor].thumbnail(response);
_l.settings.thumbnail = url;
lazyframe.settings.onThumbnailLoad.call(this, url);
}
build(_l, true);

Expand Down

0 comments on commit c3aa3cc

Please sign in to comment.