Skip to content

Commit

Permalink
Filter-based sorting fixed for single page collections #491
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Oct 16, 2024
1 parent b5ebe6b commit fcc20f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,18 @@ The maximum number of previews (thumbnails or overviews) of items that will be s

## cardViewMode

The default view mode for lists of catalogs/collections. Either `"list"` or `"cards"` (default).
The default view mode for lists of catalogs/collections. Either `"list"` or `"cards"` (default).

## cardViewSort

The default sorting for lists of catalogs/collections or items. One of:

- `"asc"`: ascending sort (default)
- `"desc"`: descending sort
- `null`: sorted as in the source files

Doesn't apply when API search filters are applied.

## showKeywordsInItemCards

Enables keywords in the lists of items if set to `true`. Defaults to `false`.
Expand Down
2 changes: 1 addition & 1 deletion src/components/Items.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
},
chunkedItems() {
let items = this.items;
if (this.sort !== 0) {
if (!this.apiFilters.sortby && this.sort !== 0) {
const collator = new Intl.Collator(this.uiLanguage);
items = items.slice(0).sort((a,b) => collator.compare(STAC.getDisplayTitle(a), STAC.getDisplayTitle(b)));
if (this.sort === -1) {
Expand Down

0 comments on commit fcc20f2

Please sign in to comment.