From e37f62ac0a8d93bd354f09567e3e19dd7e8b7d63 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 1 Nov 2023 08:19:02 +0700 Subject: [PATCH] imageZoom: dont close carousel modal on image click (#1926) Co-authored-by: Vendicated --- src/plugins/imageZoom/index.tsx | 7 +++++++ src/plugins/imageZoom/styles.css | 18 ++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 08f2e29d..75c944eb 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -186,6 +186,13 @@ export default definePlugin({ } ] }, + { + find: ".carouselModal", + replacement: { + match: /(?<=\.carouselModal.{0,100}onClick:)\i,/, + replace: "()=>{}," + } + } ], settings, diff --git a/src/plugins/imageZoom/styles.css b/src/plugins/imageZoom/styles.css index 09c3c858..51e225c0 100644 --- a/src/plugins/imageZoom/styles.css +++ b/src/plugins/imageZoom/styles.css @@ -15,19 +15,17 @@ border-radius: 0; } -.vc-imgzoom-nearest-neighbor > img { - image-rendering: pixelated; /* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */ +.vc-imgzoom-nearest-neighbor>img { + image-rendering: pixelated; + + /* https://googlechrome.github.io/samples/image-rendering-pixelated/index.html */ } /* make the carousel take up less space so we can click the backdrop and exit out of it */ -[class|="carouselModal"] { - height: fit-content; - box-shadow: none; +[class*="modalCarouselWrapper_"] { + top: 0 !important; } -[class|="wrapper"]:has(> #vc-imgzoom-magnify-modal) { - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); +[class*="carouselModal_"] { + height: 0 !important; }