mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-19 22:27: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() {
|
||||
const target = document.getElementById('image_target');
|
||||
if (target) {
|
||||
pickAndResize(target);
|
||||
bindImageForClick(target);
|
||||
window.addEventListener('resize', () => {
|
||||
pickAndResize(target);
|
||||
});
|
||||
if (!target) return;
|
||||
|
||||
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 };
|
||||
|
|
Loading…
Reference in a new issue