Fix some bugs

This commit is contained in:
Schmelczer András 2020-01-12 20:26:32 +01:00
parent 1893b774e7
commit fd14613db7
123 changed files with 187 additions and 31 deletions

9
src/page/image-viewer/image-viewer.ts Normal file → Executable file
View file

@ -28,10 +28,11 @@ export class PageImageViewer extends PageElement {
private handleClick(event: Event) {
const container = this.query('#container');
Array.prototype.forEach.call(container.childNodes, (e: HTMLElement) =>
e.remove()
);
container.appendChild((event.target as HTMLElement).cloneNode());
container.firstElementChild?.remove();
const element: HTMLImageElement = new Image();
element.src = (event.target as HTMLImageElement).src;
container.appendChild(element);
PageImageViewer.show(this.element);
}