Skip to content

Commit

Permalink
Update ImageUtilities.plugin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mwittrien committed Oct 21, 2024
1 parent c48252a commit 7bad5d7
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions Plugins/ImageUtilities/ImageUtilities.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @name ImageUtilities
* @author DevilBro
* @authorId 278543574059057154
* @version 5.4.7
* @version 5.4.8
* @description Adds several Utilities for Images/Videos (Gallery, Download, Reverse Search, Zoom, Copy, etc.)
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
Expand Down Expand Up @@ -910,24 +910,33 @@ module.exports = (_ => {
_this.cacheClickedImage(target);
BDFDB.LibraryModules.ModalUtils.openModal(modalData => {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalRoot, Object.assign({
className: BDFDB.disCN.imagemodal
className: BDFDB.disCNS.modalcarouselmodal + BDFDB.disCN.imagemodal
}, modalData, {
size: BDFDB.LibraryComponents.ModalComponents.ModalSize.DYNAMIC,
"aria-label": BDFDB.LanguageUtils.LanguageStrings.IMAGE,
children: isVideo ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ImageVideoModal, {
src: imageThrowaway.src,
poster: _this.getPosterUrl(imageThrowaway.src),
width: this.videoWidth,
naturalWidth: this.videoWidth,
height: this.videoHeight,
naturalHeight: this.videoHeight,
children: isVideo ? BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ImageModal, {
items: [{
src: imageThrowaway.src,
poster: _this.getPosterUrl(imageThrowaway.src),
width: this.videoWidth,
naturalWidth: this.videoWidth,
height: this.videoHeight,
naturalHeight: this.videoHeight
}],
renderForwardComponent: _ => {},
renderLinkComponent: props => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Anchor, props)
}) : BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ImageModal, {
src: imageThrowaway.src,
original: urlData.original,
width: this.width,
height: this.height,
items: [{
animated: false,
height: this.height,
original: imageThrowaway.src,
srcIsAnimated: false,
trigger: "CLICK",
type: "IMAGE",
url: imageThrowaway.src,
width: this.width,
zoomThumbnailPlaceholder: imageThrowaway.src
}],
className: BDFDB.disCN.imagemodalimage,
renderForwardComponent: _ => {},
renderLinkComponent: props => BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Anchor, props)
Expand Down Expand Up @@ -992,7 +1001,7 @@ module.exports = (_ => {
switchedImageProps = null;
}
else if (e.returnvalue) {
let url = this.getImageSrc(viewedImage && viewedImage.proxy_url || e.instance.props.items[0].src);
let url = this.getImageSrc(viewedImage && viewedImage.proxy_url || e.instance.props.items[0].src || e.instance.props.items[0].original);

let zoomedFitWrapper = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.imagemodalimagezoomedfit]]});
if (zoomedFitWrapper) zoomedFitWrapper.props.className = BDFDB.ArrayUtils.remove(zoomedFitWrapper.props.className.split(" "), BDFDB.disCN.imagemodalimagezoomedfit, true).join(" ");
Expand Down

0 comments on commit 7bad5d7

Please sign in to comment.