kni-labs / rrssb

:arrow_right_hook: Ridiculously Responsive Social Sharing Buttons
https://rrssb.netlify.com/
MIT License
3.4k stars 422 forks source link

Pull Request for Issue #191 #208

Open bonzani opened 7 years ago

bonzani commented 7 years ago

Pull Request for Issue #191.

Problem

The backUpFromSmall function gets unnecessarily often called because the if condition is always true. The code with the count variable and if condition was introduced in 1a55eb4c7c3e4838452d88933707979501b86dcd . The count variable was then shadowed in b179044bb005bc9d35189f0a3885f801ea42a127 with a parameter. The original count variable was then removed in b615b21f6d568f7728ccbc7a45423b504984f09a, since it was not used anymore. According to the jquery docs the second argument of each is the value and not the count.

Summary of Changes

Rename the second argument of each from count to value and move the backUpFromSmall call to the outer loop.

dbox commented 7 years ago

Looks good to me. Can anyone else confirm?

bonzani commented 6 years ago

It would be very good if someone else could confirm, since it is the only thing preventing multiple times per site usage. I am using it with the above changes on my site and did not encounter any issues.

bonzani commented 3 years ago

ping @dbox