mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 06:37:59 +01:00
don't interfere with media controls (fixes philomena-dev/philomena#77)
This commit is contained in:
parent
015fbb98ea
commit
7803050666
1 changed files with 12 additions and 6 deletions
|
@ -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 };
|
||||||
|
|
Loading…
Reference in a new issue