aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-22 04:35:49 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-22 04:35:49 +0100
commit0b5d388af213680d0def2c03d3c8814c3e2ceaa2 (patch)
tree6f0e4792e9374952c2845af84bc94428f59af644 /public
parent97737c46f37f76aa80d91c52710e2ca2c3d0ba4f (diff)
downloadgallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.tar.gz
gallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.tar.xz
gallery-0b5d388af213680d0def2c03d3c8814c3e2ceaa2.zip
WIP: FS to DB sync
Diffstat (limited to 'public')
-rw-r--r--public/gallery.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/gallery.js b/public/gallery.js
index d97a55a..ee11858 100644
--- a/public/gallery.js
+++ b/public/gallery.js
@@ -14,6 +14,7 @@ let BrowseModel = {
path: undefined,
subdirectories: [],
entries: [],
+ collator: new Intl.Collator(undefined, {numeric: true}),
async reload(path) {
if (this.path !== path) {
@@ -24,7 +25,8 @@ let BrowseModel = {
let resp = await call('browse', {path: path})
this.subdirectories = resp.subdirectories
- this.entries = resp.entries
+ this.entries = resp.entries.sort((a, b) =>
+ this.collator.compare(a.name, b.name))
},
joinPath(parent, child) {