Skip to content

Commit

Permalink
use data-lazy-loaded again
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Aug 29, 2019
1 parent 2b4145a commit 980d3e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/saber-plugin-image/lib/saber-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export default ({ Vue }) => {
if ($el.dataset.src || $el.dataset.srcset) {
lozad($el, {
loaded: el => {
this.removeBlendIn = setTimeout(() => {
el.classList.remove(styles.blendIn)
}, 300)
el.addEventListener('load', () => {
el.setAttribute('data-lazy-loaded', '')
this.removeBlendIn = setTimeout(() => {
el.classList.remove(styles.blendIn)
}, 300)
})
}
}).observe()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/saber-plugin-image/lib/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
filter: blur(5px);
}

.blendIn[data-loaded="true"] {
.blendIn[data-lazy-loaded] {
filter: none;
}

0 comments on commit 980d3e4

Please sign in to comment.