soscripted / sox

Stack Overflow Extras: a userscript for the Stack Exchange websites to add a bunch of optional toggle-able features
http://stackapps.com/q/6091/
MIT License
72 stars 15 forks source link

Fix colorAnswererComments bug with deleted users and do some extra formatting #435

Closed double-beep closed 4 years ago

double-beep commented 4 years ago

If a post had an answer from a deleted user, then the function would fail. That's because the element with the deleted user doesn't have a href which the script is told to find. Therefore, href is not defined.

I have also replaced the for loop (the one which looped through the users who had commented) with a jQuery $.each loop which appears to be more readable.

In addition, I have added an $.each to loop through all answers directly.

double-beep commented 4 years ago

I have followed your suggestion and changed the code to the old one.

shu8 commented 4 years ago

Thanks, looks great now :) Sorry if it's been a pain!