tabbar-element, thread-summary-element: small fixes

This commit is contained in:
Iris Lightshard 2024-08-16 18:21:10 -06:00
parent 89135d0399
commit 67ec0e1809
Signed by: Iris Lightshard
GPG key ID: 688407174966CAF3
2 changed files with 8 additions and 5 deletions

View file

@ -75,7 +75,7 @@ export class TabBarElement extends HTMLElement {
return ()=>{ return ()=>{
let x = util.$("mainarea_injectparent"); let x = util.$("mainarea_injectparent");
if (x) { if (x) {
x.innerHTML = `<underbbs-adapter id="adapter_${adapter}" data-name="${adapter}"></underbbs-adapter>`; x.innerHTML = `<underbbs-adapter id="adapter_${adapter}" data-name="${adapter}" data-view=""></underbbs-adapter>`;
self.setAttribute("data-currentadapter", adapter); self.setAttribute("data-currentadapter", adapter);
} }
} }

View file

@ -15,17 +15,19 @@ export class ThreadSummaryElement extends HTMLElement {
constructor() { constructor() {
super(); super();
} this.innerHTML = "<div class='thread_summary'><div class='thread_author'></div><div class='thread_text'></div><div class='thread_metadata'></div></div>"
connectedCallback() {
this.innerHTML = "<div class='thread_summary'><div class='thread_author'></div><div class='thread_text'></div><div class='thread_metadata'></div></div>"
// adapter shouldn't change, just set it here // adapter shouldn't change, just set it here
this._adapter = this.getAttribute("data-adapter") ?? ""; this._adapter = this.getAttribute("data-adapter") ?? "";
this.addEventListener("click", this.viewThread(this), false); this.addEventListener("click", this.viewThread(this), false);
} }
connectedCallback() {
}
attributeChangedCallback(attr: string, prev: string, next: string) { attributeChangedCallback(attr: string, prev: string, next: string) {
const datastore = AdapterState._instance.data.get(this._adapter); const datastore = AdapterState._instance.data.get(this._adapter);
if (!datastore) { if (!datastore) {
return; return;
@ -44,6 +46,7 @@ export class ThreadSummaryElement extends HTMLElement {
if (threadText) { if (threadText) {
threadText.innerHTML = this._msg.content; threadText.innerHTML = this._msg.content;
} }
this.setAttribute("data-author", this._msg.author);
} }
} }
break; break;