From f3756dac8a49f3b5599fd50f4c631da4168e9eb0 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 24 Nov 2025 21:13:47 +0100 Subject: add jump-to month --- static/widgets/image/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'static/widgets/image') diff --git a/static/widgets/image/index.js b/static/widgets/image/index.js index 4c25988..291cf23 100644 --- a/static/widgets/image/index.js +++ b/static/widgets/image/index.js @@ -1,5 +1,6 @@ import * as api from 'api'; import * as sfw from 'sfw'; +import Month from '../../month.js'; const { Div, Img } = sfw.element.native; const css = await sfw.css(import.meta.url, './index.css') @@ -9,6 +10,7 @@ export default class Image extends sfw.element.Container { #image #menu #id + #month constructor() { super ({ css }) @@ -43,8 +45,9 @@ export default class Image extends sfw.element.Container { ); } - set id(id) { - this.#id = id; + set metadata(image) { + this.#id = image.id; + this.#month = Month.from_unix(image.timestamp); this.#container.classList.remove('loaded'); } @@ -53,4 +56,8 @@ export default class Image extends sfw.element.Container { this.#image.src = `/api/image/load/${this.#id}`; } } + + get month() { + return this.#month; + } } -- cgit v1.2.3-70-g09d2