mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
* Fix #132143. Softer image update on rerun. * Output raw data update required.
This commit is contained in:
@@ -48,6 +48,14 @@ function renderImage(outputInfo: OutputItem, element: HTMLElement): IDisposable
|
||||
}
|
||||
};
|
||||
|
||||
if (element.firstChild) {
|
||||
const display = element.firstChild as HTMLElement;
|
||||
if (display.firstChild && display.firstChild.nodeName === 'IMG' && display.firstChild instanceof HTMLImageElement) {
|
||||
display.firstChild.src = src;
|
||||
return disposable;
|
||||
}
|
||||
}
|
||||
|
||||
const image = document.createElement('img');
|
||||
image.src = src;
|
||||
const display = document.createElement('div');
|
||||
@@ -301,6 +309,7 @@ export const activate: ActivationFunction<void> = (ctx) => {
|
||||
case 'image/jpeg':
|
||||
case 'image/git':
|
||||
{
|
||||
disposables.get(outputInfo.id)?.dispose();
|
||||
const disposable = renderImage(outputInfo, element);
|
||||
disposables.set(outputInfo.id, disposable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user