Merge pull request #3793 from Erquint/staging Clickable image attachments — no more fiddling with the spyglass button.

0a521d7a35aa7731f939a1f38438cefce40aa6b5

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
2 files changed, +11 -4Showing whitespace changes
public/scripts/chats.js+10 -4
@@ -575,8 +575,8 @@ export function isExternalMediaAllowed() {
575575 return !power_user.forbid_external_media;
576576}
577577
578578async function enlargeMessageImageexpandMessageImage(event) {
579579 const mesBlock = $(thisevent.currentTarget).closest('.mes');
580580 const mesId = mesBlock.attr('mesid');
581581 const message = chat[mesId];
582582 const imgSrc = message?.extra?.image;
@@ -620,7 +620,12 @@ async function enlargeMessageImage() {
620620 popup.completeCancelled();
621621 });
622622
623623 await popup.show();
624+ return img;
625+}
626+
627+function expandAndZoomMessageImage(event) {
628+ expandMessageImage(event).click();
624629}
625630
626631async function deleteMessageImage() {
@@ -1603,7 +1608,8 @@ jQuery(function () {
16031608 reloadCurrentChat();
16041609 });
16051610
16061611 $(document).on('click', '.mes_img_enlargemes_img', enlargeMessageImageexpandMessageImage);
1612+ $(document).on('click', '.mes_img_enlarge', expandAndZoomMessageImage);
16071613 $(document).on('click', '.mes_img_delete', deleteMessageImage);
16081614
16091615 $('#file_form_input').on('change', async () => {
public/style.css+1 -0
@@ -4995,6 +4995,7 @@ a:hover {
49954995 max-width: 100%;
49964996 max-height: 40vh;
49974997 image-rendering: -webkit-optimize-contrast;
4998+ cursor: pointer;
49984999}
49995000
50005001.mes_img_swipes,