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:
+32
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user