Skip to content

Instantly share code, notes, and snippets.

@kubosho
Last active February 16, 2016 04:07
Show Gist options
  • Select an option

  • Save kubosho/d2a49b1c1b1b231195b8 to your computer and use it in GitHub Desktop.

Select an option

Save kubosho/d2a49b1c1b1b231195b8 to your computer and use it in GitHub Desktop.
👍 eraser in GitHub issue
function closest(baseElement, className) {
var targetElement = baseElement;
if(!(targetElement.classList.contains(className))) {
targetElement = baseElement.parentElement;
return closest(targetElement, className);
}
return targetElement;
}
Array.prototype.forEach.call(document.querySelectorAll('[title=":+1:"], [title=":thumbsup:"]'), function(plusoneElement) {
closest(plusoneElement, 'comment').style.display = 'none';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment