From efb92a00185963a763217d4bedce7a1591c6dc22 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 20 Nov 2025 06:56:43 +0100 Subject: image: implement removing --- static/pages/image-viewer/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'static/pages/image-viewer/index.js') diff --git a/static/pages/image-viewer/index.js b/static/pages/image-viewer/index.js index 0cf8598..e418e6f 100644 --- a/static/pages/image-viewer/index.js +++ b/static/pages/image-viewer/index.js @@ -7,6 +7,7 @@ const css = await sfw.css(import.meta.url, './index.css') export default class ImageViewer extends sfw.element.Container { #container + #subtitle constructor() { super({ css }); @@ -15,15 +16,24 @@ export default class ImageViewer extends sfw.element.Container { this.onolder = () => {} this.body.append( - this.#container = Div.new({ id: 'container' }) + this.#container = Div.new({ + id: 'container', + children: [ + this.#subtitle = Div.new({ + id: 'subtitle', + innerHTML: 'Powered by Memora' + }) + ], + }) ); } add(id) { - this.#container.append(Image.new({ id })) + this.#container.insertBefore(Image.new({ id }), this.#subtitle); } clear() { this.#container.innerHTML = ''; + this.#container.append(this.#subtitle); } } -- cgit v1.2.3-70-g09d2