aboutsummaryrefslogtreecommitdiff
path: root/static/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/index.js')
-rw-r--r--static/index.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/static/index.js b/static/index.js
index c5bfccc..e67d234 100644
--- a/static/index.js
+++ b/static/index.js
@@ -1,6 +1,6 @@
import * as sfw from 'sfw';
import * as api from 'api';
-import { literal as m } from './month.js';
+import Month from './month.js';
import * as service_worker from './service-worker/index.js';
import LoginView from './pages/login/index.js';
@@ -19,8 +19,12 @@ const image_viewer = ImageViewer.new();
const reload = () => {
image_viewer.clear();
api.images.list().then(images => {
+ const last = Month.from_unix(images[0].timestamp);
+ let first = Month.from_unix(images.findLast(i => i.timestamp).timestamp);
+ month_select.months = first.to(last);
+
for (const image of images) {
- image_viewer.add(image.id);
+ image_viewer.add(image);
}
});
}
@@ -50,9 +54,8 @@ const search = Search.new({
});
const month_select = MonthSelect.new({
- months: m`2019-08`.to(m`2025-11`),
+ onmonth: (month) => image_viewer.jump_to(month),
});
-
const upload_bar = UploadBar.new();
const settings = SettingsView.new({