Forráskód Böngészése

Bugfix. Images automatically load in modal

JC Brand 4 éve
szülő
commit
3d3242c00d
2 módosított fájl, 3 hozzáadás és 3 törlés
  1. 1 1
      src/shared/chat/message-body.js
  2. 2 2
      src/shared/rich-text.js

+ 1 - 1
src/shared/chat/message-body.js

@@ -37,7 +37,7 @@ export default class MessageBody extends CustomElement {
             'embed_audio': this.embed_audio,
             'embed_videos': this.embed_videos,
             'nick': this.model.collection.chatbox.get('nick'),
-            'onImgClick': this.onImgClick,
+            'onImgClick': (ev) => this.onImgClick(ev),
             'onImgLoad': () => this.onImgLoad(),
             'render_styling': !this.model.get('is_unstyled') && api.settings.get('allow_message_styling'),
             'show_images': this.show_images,

+ 2 - 2
src/shared/rich-text.js

@@ -113,8 +113,8 @@ export class RichText extends String {
             if (this.show_images && isImageURL(url_text) && isImageDomainAllowed(url_text)) {
                 template = tpl_image({
                     'url': filtered_url,
-                    'onClick': this.onImgLoad,
-                    'onLoad': this.onImgClick
+                    'onClick': this.onImgClick,
+                    'onLoad': this.onImgLoad
                 });
             } else if (this.embed_videos && isVideoURL(url_text) && isVideoDomainAllowed(url_text)) {
                 template = tpl_video(filtered_url);