Click on an image to zoom larger

This commit is contained in:
Jeremy Zhang 2018-02-18 20:53:32 +00:00
parent ff17f1a338
commit c3acc0054f
3 changed files with 12 additions and 2 deletions

View File

@ -761,6 +761,10 @@ p.mentioned span.chatmessage {
width: 100%; width: 100%;
} }
.richembed .image img.materialboxed.active {
max-width: none;
}
#chatcontent img.attachment { #chatcontent img.attachment {
width: 100%; width: 100%;
max-width: 300px; max-width: 300px;
@ -769,6 +773,11 @@ p.mentioned span.chatmessage {
display: block; display: block;
} }
#chatcontent img.attachment.materialboxed.active {
max-width: none;
max-height: none;
}
#emoji-picker { #emoji-picker {
color: black; color: black;
position: fixed; position: fixed;

View File

@ -905,7 +905,7 @@
attach = " "; attach = " ";
} }
if (message.attachments[i].url.endsWith(".png") || message.attachments[i].url.endsWith(".jpg") || message.attachments[i].url.endsWith(".jpeg") || message.attachments[i].url.endsWith(".gif")) { if (message.attachments[i].url.endsWith(".png") || message.attachments[i].url.endsWith(".jpg") || message.attachments[i].url.endsWith(".jpeg") || message.attachments[i].url.endsWith(".gif")) {
attach += "<img class=\"attachment\" src=\"" + message.attachments[i].url + "\">"; attach += "<img class=\"attachment materialboxed\" src=\"" + message.attachments[i].url + "\">";
} else { } else {
attach += message.attachments[i].url; attach += message.attachments[i].url;
} }
@ -1159,6 +1159,7 @@
target: "_blank" target: "_blank"
}); });
$('.tooltipped').tooltip(); $('.tooltipped').tooltip();
$('.materialboxed').materialbox();
process_message_users_cache(); process_message_users_cache();
return last; return last;
} }

View File

@ -380,7 +380,7 @@
</div> </div>
{{#image}} {{#image}}
<div class="image"> <div class="image">
<img src="{{image.proxy_url}}"> <img src="{{image.proxy_url}}" class="materialboxed">
</div> </div>
{{/image}} {{/image}}
{{#toRenderFooter}} {{#toRenderFooter}}