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 ()=>{
let x = util.$("mainarea_injectparent");
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);
}
}

View file

@ -15,9 +15,6 @@ export class ThreadSummaryElement extends HTMLElement {
constructor() {
super();
}
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
@ -25,7 +22,12 @@ export class ThreadSummaryElement extends HTMLElement {
this.addEventListener("click", this.viewThread(this), false);
}
connectedCallback() {
}
attributeChangedCallback(attr: string, prev: string, next: string) {
const datastore = AdapterState._instance.data.get(this._adapter);
if (!datastore) {
return;
@ -44,6 +46,7 @@ export class ThreadSummaryElement extends HTMLElement {
if (threadText) {
threadText.innerHTML = this._msg.content;
}
this.setAttribute("data-author", this._msg.author);
}
}
break;