aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services
diff options
context:
space:
mode:
authorpacien2020-09-19 22:25:54 +0200
committerpacien2020-09-19 22:25:54 +0200
commitd9e51ff55ef494d37c5e23ef8fb79500fa5585c5 (patch)
treeae2c25614c71fe1c21489a5c7b5a83b718e9701e /viewer/src/services
parentab97f64575f1b51bacced6ce1bc6bf22e0354615 (diff)
downloadldgallery-d9e51ff55ef494d37c5e23ef8fb79500fa5585c5.tar.gz
viewer: rename title sort order
To avoid confusion with filenames.
Diffstat (limited to 'viewer/src/services')
-rw-r--r--viewer/src/services/itemComparators.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/viewer/src/services/itemComparators.ts b/viewer/src/services/itemComparators.ts
index 64ce288..e131b8b 100644
--- a/viewer/src/services/itemComparators.ts
+++ b/viewer/src/services/itemComparators.ts
@@ -23,10 +23,10 @@ export type ItemComparator = (left: Gallery.Item, right: Gallery.Item) => number
23export type ItemSort = { name: Gallery.ItemSortStr; text: TranslateResult; fn: ItemComparator }; 23export type ItemSort = { name: Gallery.ItemSortStr; text: TranslateResult; fn: ItemComparator };
24 24
25export default class ItemComparators { 25export default class ItemComparators {
26 static readonly DEFAULT = ItemComparators.sortByNameAsc; 26 static readonly DEFAULT = ItemComparators.sortByTitleAsc;
27 27
28 static readonly ITEM_SORTS: ItemSort[] = [ 28 static readonly ITEM_SORTS: ItemSort[] = [
29 { name: "name_asc", text: i18n.t("command.sort.byNameAsc"), fn: ItemComparators.sortByNameAsc }, 29 { name: "title_asc", text: i18n.t("command.sort.byTitleAsc"), fn: ItemComparators.sortByTitleAsc },
30 { name: "date_asc", text: i18n.t("command.sort.byDateAsc"), fn: ItemComparators.sortByDateAsc }, 30 { name: "date_asc", text: i18n.t("command.sort.byDateAsc"), fn: ItemComparators.sortByDateAsc },
31 { 31 {
32 name: "date_desc", 32 name: "date_desc",
@@ -35,7 +35,7 @@ export default class ItemComparators {
35 }, 35 },
36 ]; 36 ];
37 37
38 static sortByNameAsc(left: Gallery.Item, right: Gallery.Item): number { 38 static sortByTitleAsc(left: Gallery.Item, right: Gallery.Item): number {
39 return left.title.localeCompare(right.title, undefined, { 39 return left.title.localeCompare(right.title, undefined, {
40 sensitivity: "base", 40 sensitivity: "base",
41 ignorePunctuation: true, 41 ignorePunctuation: true,