text search and ui fixes:
- text support via <coll>/textIndex api, fallback to existing pageList text data - page sorting: add score column for page search results with query - safari: add min-height: fit-content for safari - refresh: ensure replay refresh triggers refresh icon - embeds: ensure deep linking working for search view pages (map view and query params)
This commit is contained in:
+17
-5
@@ -16,6 +16,12 @@ class Sorter extends LitElement
|
||||
|
||||
this.numResults = DEFAULT_RESULTS;
|
||||
this.defaultDesc = false;
|
||||
|
||||
this.sortKey = "url";
|
||||
this.sortDesc = false;
|
||||
|
||||
this.defaultKey = "";
|
||||
this.defaultDesc = false;
|
||||
}
|
||||
|
||||
static get properties() {
|
||||
@@ -68,13 +74,19 @@ class Sorter extends LitElement
|
||||
this.sortedData = [...this.data];
|
||||
this.numResults = DEFAULT_RESULTS;
|
||||
|
||||
this.sortedData.sort((first, second) => {
|
||||
if (first[this.sortKey] === second[this.sortKey]) {
|
||||
return 0;
|
||||
if (this.sortKey === "") {
|
||||
if (this.sortDesc) {
|
||||
this.sortedData.reverse();
|
||||
}
|
||||
} else {
|
||||
this.sortedData.sort((first, second) => {
|
||||
if (first[this.sortKey] === second[this.sortKey]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (this.sortDesc == (first[this.sortKey] < second[this.sortKey])) ? 1 : -1;
|
||||
});
|
||||
return (this.sortDesc == (first[this.sortKey] < second[this.sortKey])) ? 1 : -1;
|
||||
});
|
||||
}
|
||||
|
||||
this.sendSortChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user