Fix ImageZoom

Also fixes the image modal being off centre when having the plugin enabled

Co-Authored-By: sadan <117494111+sadan4@users.noreply.github.com>
This commit is contained in:
Vendicated 2024-10-23 04:22:11 +02:00
parent a11ccde40f
commit 0af820c874
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
6 changed files with 28 additions and 28 deletions

View file

@ -156,14 +156,10 @@ export default definePlugin({
patches: [
{
find: "Messages.OPEN_IN_BROWSER",
find: ".contain,SCALE_DOWN:",
replacement: {
// there are 2 image thingies. one for carosuel and one for the single image.
// so thats why i added global flag.
// also idk if this patch is good, should it be more specific?
// https://regex101.com/r/xfvNvV/1
match: /return.{1,200}\.wrapper.{1,200}src:\i,/g,
replace: `$&id: '${ELEMENT_ID}',`
match: /\.slide,\i\),/g,
replace: `$&id:"${ELEMENT_ID}",`
}
},
@ -185,13 +181,6 @@ export default definePlugin({
replace: "$&$self.unMountMagnifier();"
}
]
},
{
find: ".carouselModal",
replacement: {
match: /(?<=\.carouselModal.{0,100}onClick:)\i,/,
replace: "()=>{},"
}
}
],