Update ImageUtilities.plugin.js

This commit is contained in:
Mirco Wittrien 2022-12-17 12:29:22 +01:00
parent cc2492d7b2
commit 2a8bfa9554
1 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@
* @name ImageUtilities
* @author DevilBro
* @authorId 278543574059057154
* @version 5.0.7
* @version 5.0.8
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -263,6 +263,7 @@ module.exports = (_ => {
"UserBanner"
],
componentDidMount: [
"LazyImage",
"ImageModal"
],
componentDidUpdate: [
@ -1189,10 +1190,10 @@ module.exports = (_ => {
BDFDB.ReactUtils.forceUpdate(e.instance);
}
}
if (BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.getInstance(e.node), {name: "ImageModal", up: true})) {
if (e.node.querySelector("video") && !BDFDB.LibraryStores.AccessibilityStore.useReducedMotion) e.node.style.setProperty("pointer-events", "none");
if (this.settings.viewerSettings.zoomMode && e.node.querySelector("img") && !e.node._zoomListenerAdded && !e.node.querySelector("video") && !BDFDB.DOMUtils.containsClass(e.node.parentElement, BDFDB.disCN._imageutilitiessibling)) {
e.node._zoomListenerAdded = true;
if (e.methodname == "componentDidMount" && BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.getInstance(e.node), {name: "ImageModal", up: true})) {
let isVideo = typeof e.instance.props.children == "function";
if (isVideo && !BDFDB.LibraryStores.AccessibilityStore.useReducedMotion) e.node.style.setProperty("pointer-events", "none");
if (this.settings.viewerSettings.zoomMode && !isVideo && !BDFDB.DOMUtils.containsClass(e.node.parentElement, BDFDB.disCN._imageutilitiessibling)) {
e.node.style.setProperty("cursor", "zoom-in");
e.node.addEventListener("mousedown", event => {
if (event.which != 1 || e.node.querySelector("video")) return;