image loading

This commit is contained in:
Piyush मिश्रः 2021-05-26 10:52:33 +05:30
parent 7bfceea7d5
commit 46c2bc6df8
1 changed files with 7 additions and 1 deletions

View File

@ -116,7 +116,13 @@ let Messages = class {
} }
static pushImage(sender, src, msg_id) { static pushImage(sender, src, msg_id) {
Messages.pushMessage(sender,[$('<img>', {src: src, width: 300})],msg_id); var sp = $('<span>', {class: 'text-grey bd-light'}).append(' Loading Image... ');
var img = $('<img>', {src: src, width: 300});
img.on('load', function() {
sp.empty();
sp.append(img);
});
Messages.pushMessage(sender,[sp],msg_id);
} }
static addReaction(sender, emoji, msg_id) { static addReaction(sender, emoji, msg_id) {