Reddit-Enhancement-Suite
Reddit-Enhancement-Suite copied to clipboard
replace .parentNode.parentNode with better selectors
there are many older bits of RES which suffer from .parentNode.parentNode...
, when they ought to use .closest('.thing')
or a similar selector. This is a problem when reddit changes its HTML structure a little. We should do a sweep for any instances of this and maybe implement a $.fn.thing = function(selector) { var thing = $(this).closest(".thing"); if (selector) { var selected = thing.find(selector); return selected } else return thing; }
Does this bug still exists? I can help resolve it. :)