Fix back button; add title

This commit is contained in:
Pieter Vander Vennet 2021-01-08 18:02:07 +01:00
parent 6e77504854
commit 2f57010202
14 changed files with 115 additions and 43 deletions

View file

@ -43,27 +43,23 @@ export class QueryParameters {
private static Serialize() {
const parts = []
for (const key of QueryParameters.order) {
if (QueryParameters.knownSources[key] === undefined || QueryParameters.knownSources[key].data === undefined) {
if (QueryParameters.knownSources[key]?.data === undefined) {
continue;
}
if (QueryParameters.knownSources[key].data === undefined) {
continue;
}
if (QueryParameters.knownSources[key].data === "undefined") {
continue;
}
if (QueryParameters.knownSources[key].data == QueryParameters.defaults[key]) {
if (QueryParameters.knownSources[key].data === QueryParameters.defaults[key]) {
continue;
}
parts.push(encodeURIComponent(key) + "=" + encodeURIComponent(QueryParameters.knownSources[key].data))
}
// Don't pollute the history every time a parameter changes
history.replaceState(null, "", "?" + parts.join("&") + "#" + Hash.hash.data);
history.replaceState(null, "", "?" + parts.join("&") + Hash.Current());
}