Novicell/novicell-lazyload

Should check if window is defined

Opened this issue · 0 comments

Sometimes you want to force a lazyload on an image, in case of a resize event or similar.

When trying to do this in Nuxt by taking the class instance and running the .lazyLoad function it will break even if put within a process.client check since we modify window outside of the class (See lines 14. 15: https://github.com/Novicell/novicell-lazyload/blob/master/js/lazy-images.js#L14)

I suggest we wrap the config init on window in a window check.