wip: fixing bugs in image uploads and display

This commit is contained in:
or-else
2020-10-15 17:36:35 -07:00
parent de1028e141
commit 738d84045d
8 changed files with 64 additions and 37 deletions
+12 -7
View File
@@ -6733,7 +6733,9 @@ function draftyFormatter(style, data, values, key) {
switch (style) {
case 'IM':
if (data) {
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_2__["Drafty"].isUploading(data)) {
const uploading = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__["Drafty"].isUploading(data);
if (uploading) {
el = 'UploadingImage';
}
@@ -6747,13 +6749,16 @@ function draftyFormatter(style, data, values, key) {
width: dim.dstWidth + 'px',
height: dim.dstHeight + 'px'
};
attr.src = Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_7__["sanitizeImageUrl"])(attr.src);
if (attr.src) {
attr.onClick = this.handleImagePreview;
attr.className += ' image-clickable';
} else {
attr.src = 'img/broken_image.png';
if (!uploading) {
attr.src = Object(_lib_utils_js__WEBPACK_IMPORTED_MODULE_7__["sanitizeImageUrl"])(attr.src);
if (attr.src) {
attr.onClick = this.handleImagePreview;
attr.className += ' image-clickable';
} else {
attr.src = 'img/broken_image.png';
}
}
}