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:
Ilya Kreymer
2020-08-07 16:48:02 -07:00
parent 69e7982d31
commit 4efce70a39
10 changed files with 303 additions and 193 deletions
+17 -5
View File
@@ -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();
}