Skip to content

Commit

Permalink
Make GitHub avatars non-clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKay committed Nov 3, 2023
1 parent 6adbb7c commit 6e7b271
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hedgedocs/web/javascripts/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ function makeImagesClickable() {
background.addEventListener('click', hideImagePreview)

const images = document.querySelector('.md-main').querySelectorAll('img')

for(let i = 0; i < images.length; i++) {
const image = images[i]
if (image.classList.contains('not-clickable') || image.parentElement.classList.contains('md-logo')) continue

if (
image.classList.contains('not-clickable')
|| image.parentElement.classList.contains('md-logo')
|| image.parentElement.classList.contains('github-avatar')
) continue

image.setAttribute('style', 'cursor: pointer')
image.addEventListener('click', imageClicked)
}
Expand Down

0 comments on commit 6e7b271

Please sign in to comment.