thinker3197 / progressively

A JavaScript library to load images progressively 🌇
https://thinker3197.github.io/progressively
MIT License
698 stars 68 forks source link

Update build system & fix #22 #30

Closed Toanzzz closed 2 months ago

Toanzzz commented 6 years ago

First off, thank you for such amazing library. I've been using this lib for some small project, but the bug in #22 are so annoying that I decided to fix it myself. So here we are:

[JS]

[CSS]

(That were a lot of changes, sorry. I just want to help you upgrade the code to newer, modern style and don't mean to offend anyone. Please let me know what you think about this PR 😄)

thinker3197 commented 6 years ago

This is a much-needed PR @Toanzzz. Thanks for your time and effort! Give me a day or two and I'll merge this after reviewing changes.

Toanzzz commented 6 years ago

That was a quick reply thinkker3197. Sorry that I kind of take it my way and add so many things. If you think any changes are unnecessary, please feel free to edit them (and I'll appreciated if you let me know how to improve it)

dallington commented 5 years ago

@Toanzzz First, thanks for the correction, and I'm sorry for the way of writing, I'm Brazilian and I'm using google translator.

I believe I encountered an error on line 212. SecondaryObject did not exist. I added the following code to verify.

for (const prop in primaryObject) {      o [prop] = (secondaryObject! = null && secondaryObject.hasOwnProperty (prop))? secondaryObject [prop]: primaryObject [prop]    }

Toanzzz commented 5 years ago

@dallington that extend function that cause the error is the original one that I extracted and move to bottom. I checked and it only used once when initializing the settings. I believe we can use ES6's spread operator for this kind of thing:

// Original
self._settings = extend(self._settings, options)

// ES6
self._settings = { ...self._settings, ...options}

With this we don't have to check anything :)

Toanzzz commented 2 months ago

I'm going to close this PR since it look like the project is not active any more :( Thanks for all your hard work @thinker3197 🙏