Fix some bugs
This commit is contained in:
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
9
src/page/image-viewer/image-viewer.ts
Normal file → Executable 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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue