Replace .src with setAttribute.

Change-Id: I857d110b7498d231becb748c3c938c83e4bbdd39
This commit is contained in:
Tao Zhou
2019-11-08 09:25:35 +01:00
parent d9a9a99071
commit 34a9cb7429

View File

@@ -95,7 +95,7 @@
image._width = imageEl.naturalWidth;
this._updateImageLabel(section, className, image);
}.bind(this);
imageEl.src = 'data:' + image.type + ';base64, ' + image.body;
imageEl.setAttribute('src', `data:${image.type};base64, ${image.body}`);
imageEl.addEventListener('error', () => {
imageEl.remove();
td.textContent = '[Image failed to load]';