Reddit-Enhancement-Suite icon indicating copy to clipboard operation
Reddit-Enhancement-Suite copied to clipboard

replace .parentNode.parentNode with better selectors

Open jewel-andraia opened this issue 10 years ago • 1 comments

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; }

jewel-andraia avatar Aug 22 '14 18:08 jewel-andraia

Does this bug still exists? I can help resolve it. :)

jagjotsinghparry avatar Apr 06 '21 09:04 jagjotsinghparry