From 928fa7a3fc5ecba6387d91fc30328bd7931661be Mon Sep 17 00:00:00 2001 From: Kristan Schlikow Date: Sun, 14 Apr 2024 17:12:26 +0200 Subject: [PATCH] Close zoomed image when clicking the parent div instead of image Makes it easier to close on mobile --- public/css/mobile-styles.css | 2 -- public/script.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/public/css/mobile-styles.css b/public/css/mobile-styles.css index c5e4eb1a7..dbc2d61a3 100644 --- a/public/css/mobile-styles.css +++ b/public/css/mobile-styles.css @@ -28,7 +28,6 @@ z-index: 30; overflow: hidden; right: 0; - top: 50px; aspect-ratio: 2 / 3; width: fit-content; max-height: calc(60vh - 60px); @@ -373,7 +372,6 @@ overflow: hidden; display: none; right: 0; - top: 50px; aspect-ratio: 2 / 3; left: 50%; transform: translateX(-50%); diff --git a/public/script.js b/public/script.js index 66f47fd8c..da93f0457 100644 --- a/public/script.js +++ b/public/script.js @@ -10241,7 +10241,7 @@ jQuery(async function () { if (power_user.zoomed_avatar_magnification) $('.zoomed_avatar_container').izoomify(); - zoomedAvatarImgElement.on('click', (e) => { + $('.zoomed_avatar').on('click', (e) => { $(`.zoomed_avatar[forChar="${charname}"]`).fadeOut(); setTimeout(function() { $(`.zoomed_avatar[forChar="${charname}"]`).remove(); }, 410); });