Photo Views: Count a mouseover as a view too

For video elements (animated GIFs), since the 'click' for lightbox modal
doesn't work, mouseover and play/pause count as views. This can unfairly
lead videos to climb as the most viewed images while pictures need a
click or a 'like' to count.

So, count images as viewed on their mouseover event as well.
This commit is contained in:
Noah Petherbridge 2024-10-19 15:44:50 -07:00
parent b52d9df958
commit 7ffcd6b3a8

View File

@ -945,7 +945,13 @@
// Log a view of this photo.
markImageViewed(photoID);
})
});
// Images: count a mouseover as a view to be on par with videos, otherwise
// videos climb to the top of the most viewed list too quickly.
node.addEventListener("mouseover", (e) => {
markImageViewed(photoID);
});
});
});
</script>