loryjs / lory

☀ Touch enabled minimalistic slider written in vanilla JavaScript.
http://loryjs.github.io/lory/
MIT License
2.28k stars 243 forks source link

Fixed issue when using with SSR apps due to window not being defined #716

Closed MrSlide closed 6 years ago

MrSlide commented 6 years ago

When using Lory in applications that use server side rendering (SSR), like Vue.js or React applications, rendering the applications fails due to Lory trying to use the window object.

This fix checks that window is defined, and if not, uses null as the default value for window.

Saturate commented 6 years ago

Hey @MrSlide thanks for the PR! Unfortunately there are some conflicts, due to other updates that must be fixed. It seems like all that's needed is a new build , but none the less it's needed.

Thanks!

MrSlide commented 6 years ago

Hi @Saturate I just resolved all the conflicts

Saturate commented 6 years ago

Hi @MrSlide it still conflicts for me :-(

MrSlide commented 6 years ago

@Saturate I fixed the merge conflicts again, only the dist files are conflicting, this will happen every time something is merged with the master branch but can easily be fixed by just creating a new build.

meandmax commented 6 years ago

I merge this now, but again need to add an empty trigger commit to the master to trigger a build. Please keep in mind that if you do your commits use either https://github.com/commitizen/cz-cli or just do it manually. Check out this: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits

cheers