don't interfere with media controls (fixes philomena-dev/philomena#77)

This commit is contained in:
byte[] 2020-12-02 19:19:37 -05:00
parent 015fbb98ea
commit 7803050666

View file

@ -160,13 +160,19 @@ function bindImageForClick(target) {
function bindImageTarget() { function bindImageTarget() {
const target = document.getElementById('image_target'); const target = document.getElementById('image_target');
if (target) { if (!target) return;
pickAndResize(target);
bindImageForClick(target); pickAndResize(target);
window.addEventListener('resize', () => {
pickAndResize(target); if (target.dataset.mimeType === 'video/webm') {
}); // Don't interfere with media controls on video
return;
} }
bindImageForClick(target);
window.addEventListener('resize', () => {
pickAndResize(target);
});
} }
export { bindImageTarget }; export { bindImageTarget };