misc ui fixes:

- update logo, fix logo styling in docs
- fix terms modal
- embeds: add option to support 'deep-linking' into embed via hash
This commit is contained in:
Ilya Kreymer
2020-05-19 10:25:33 -07:00
parent 5014cff233
commit ab8e051ff0
9 changed files with 138 additions and 100 deletions
+32 -1
View File
@@ -13,6 +13,7 @@ class EmbedRWP extends LitElement
this.config = "";
this.coll = "";
this.paramString = null;
this.deepLink = false;
}
static get properties() {
@@ -28,7 +29,9 @@ class EmbedRWP extends LitElement
config: { type: String },
paramString: { type: String },
hashString: { type: String }
hashString: { type: String },
deepLink: { type: Boolean }
}
}
@@ -40,8 +43,36 @@ class EmbedRWP extends LitElement
if (event.data.title) {
this.title = event.data.title;
}
console.log(event.data);
if (!this.deepLink) {
return;
}
const currHash = new URLSearchParams({
url: event.data.url,
ts: event.data.ts,
});
window.location.hash = "#" + currHash.toString();
}
});
if (this.deepLink) {
this.updateFromHash();
window.addEventListener("hashchange", (event) => this.updateFromHash());
}
}
updateFromHash() {
const qs = new URLSearchParams(window.location.hash.slice(1));
if (qs.has("url")) {
this.url = qs.get("url");
}
if (qs.has("ts")) {
this.ts = qs.get("ts");
}
}
updated(changedProperties) {