blob: e418e6fd93752ece0da169888bb409dc2cdb076c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import * as sfw from 'sfw';
const { Div, Img } = sfw.element.native;
import Image from '../../widgets/image/index.js';
const css = await sfw.css(import.meta.url, './index.css')
export default class ImageViewer extends sfw.element.Container {
#container
#subtitle
constructor() {
super({ css });
this.onnewer = () => {}
this.onolder = () => {}
this.body.append(
this.#container = Div.new({
id: 'container',
children: [
this.#subtitle = Div.new({
id: 'subtitle',
innerHTML: 'Powered by <i>Memora<i>'
})
],
})
);
}
add(id) {
this.#container.insertBefore(Image.new({ id }), this.#subtitle);
}
clear() {
this.#container.innerHTML = '';
this.#container.append(this.#subtitle);
}
}
|