Skip to content

Instantly share code, notes, and snippets.

@gaga5lala
Last active December 8, 2017 01:51
Show Gist options
  • Save gaga5lala/06e0f308a0a16fb27675ce354f9c8cb3 to your computer and use it in GitHub Desktop.
Save gaga5lala/06e0f308a0a16fb27675ce354f9c8cb3 to your computer and use it in GitHub Desktop.
Bookmarklet to hide gitlab system notes. (e.g, issue edit history)
javascript:(function(){document.querySelectorAll("ul.notes .system-note").forEach(function(ele){ele.style.display ='none'})})()
javascript:(function(){document.querySelectorAll("ul.notes .system-note").forEach(function(ele){ele.style.display = ((ele.style.display === '' || ele.style.display === 'block') ? 'none' : 'block')})})()
@gaga5lala
Copy link
Author

gaga5lala commented Dec 7, 2017

add toggle feature

// has bug due to async problem
eles = document.querySelectorAll("ul.notes .system-note");
mode = eles[0].style.display === 'block' ? 'none' : 'block';
eles.forEach(function(ele){ele.style.display =mode})
// works, but may encounter performance issue
document.querySelectorAll("ul.notes .system-note").forEach(function(ele){
    ele.style.display = (ele.style.display === 'block' ? 'none' : 'block')
})

@gaga5lala
Copy link
Author

display attribute is '' in the beginning.

document.querySelectorAll("ul.notes .system-note").forEach(function(ele){
    ele.style.display = ((ele.style.display === '' ||  ele.style.display === 'block') ? 'none' : 'block')
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment