diff options
author | pacien | 2020-09-25 09:22:44 +0200 |
---|---|---|
committer | pacien | 2020-09-25 09:22:44 +0200 |
commit | 25a9af7212d757a53258990668620157c8ebe2e5 (patch) | |
tree | 4a51a6201b2e4c55056b0321d04cb4bd7d678935 /viewer | |
parent | c108a99e128c02d20930775222f6118a460f80b1 (diff) | |
download | ldgallery-25a9af7212d757a53258990668620157c8ebe2e5.tar.gz |
viewer/services/itemComparators: set default item sort order to date_asc
It's the most reasonable default that doesn't break the order of sequence of photos.
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/ldgallery-viewer.7.md | 2 | ||||
-rw-r--r-- | viewer/src/services/itemComparators.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/viewer/ldgallery-viewer.7.md b/viewer/ldgallery-viewer.7.md index 6b31879..96070dc 100644 --- a/viewer/ldgallery-viewer.7.md +++ b/viewer/ldgallery-viewer.7.md | |||
@@ -77,7 +77,7 @@ galleryIndex | |||
77 | initialItemSort | 77 | initialItemSort |
78 | : Order in which gallery items are originally to be displayed. | 78 | : Order in which gallery items are originally to be displayed. |
79 | Possible values are "title_asc", "date_asc", "date_desc". | 79 | Possible values are "title_asc", "date_asc", "date_desc". |
80 | Defaults to "title_asc". | 80 | Defaults to "date_asc". |
81 | Titles are sorted using a human-friendly _natural sort order_ which treats multi-digit numbers atomically. | 81 | Titles are sorted using a human-friendly _natural sort order_ which treats multi-digit numbers atomically. |
82 | The item path is used as a tie-breaker for all the defined orders. | 82 | The item path is used as a tie-breaker for all the defined orders. |
83 | 83 | ||
diff --git a/viewer/src/services/itemComparators.ts b/viewer/src/services/itemComparators.ts index ab1036d..82757ca 100644 --- a/viewer/src/services/itemComparators.ts +++ b/viewer/src/services/itemComparators.ts | |||
@@ -41,7 +41,7 @@ export default class ItemComparators { | |||
41 | }, | 41 | }, |
42 | ]; | 42 | ]; |
43 | 43 | ||
44 | static readonly DEFAULT = ItemComparators.ITEM_SORTS[0].fn; | 44 | static readonly DEFAULT = ItemComparators.ITEM_SORTS[1].fn; |
45 | 45 | ||
46 | static sortByPathAsc(left: Gallery.Item, right: Gallery.Item): number { | 46 | static sortByPathAsc(left: Gallery.Item, right: Gallery.Item): number { |
47 | return left.path.localeCompare(right.path, undefined, { | 47 | return left.path.localeCompare(right.path, undefined, { |