Skip to content

Commit

Permalink
Added support for 'sizes' attribute. Also pushed to v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rouralberto committed Oct 28, 2016
1 parent fb18c24 commit d86b0c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"main": "src/perezoso.js",
"author": "Alberto Roura",
"description": "Perezoso is a lightweight javascript plugin to lazy load images.",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/roura356a/perezoso",
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/perezoso.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* perezoso 1.0.2
* perezoso 1.0.3
* Repo: https://github.com/roura356a/perezoso
*/

Expand Down Expand Up @@ -44,6 +44,9 @@
if (!!imgAttributes.class) {
img.setAttribute('class', imgAttributes.class);
}
if (!!imgAttributes.sizes) {
img.setAttribute('sizes', imgAttributes.sizes);
}
img.alt = imgAttributes.alt;
img.src = imgAttributes.src;

Expand Down Expand Up @@ -74,6 +77,7 @@
return {
src: imgPlaceholder.getAttribute('data-src'),
class: imgPlaceholder.getAttribute('data-class'),
sizes: imgPlaceholder.getAttribute('data-sizes'),
alt: imgPlaceholder.getAttribute('data-alt'),
title: imgPlaceholder.getAttribute('data-title'),
errorHandler: imgPlaceholder.getAttribute('data-error-handler'),
Expand Down

0 comments on commit d86b0c9

Please sign in to comment.