mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Ensure profile modal mounts directly in modal container
This commit is contained in:
1 parent
ee2175a7ad
commit
cfa2e2f8bf
1 file changed
+11
-4
@@ -446,10 +446,17 @@ export class ProfileModalController {
|
||||
}
|
||||
|
||||
const html = await response.text();
|
||||
const wrapper = document.createElement("div");
|
||||
wrapper.innerHTML = html;
|
||||
this.removeTrackingScripts(wrapper);
|
||||
this.modalContainer.appendChild(wrapper);
|
||||
const template = document.createElement("template");
|
||||
template.innerHTML = html;
|
||||
this.removeTrackingScripts(template.content);
|
||||
|
||||
const modalRoot = template.content.querySelector("#profileModal");
|
||||
if (!(modalRoot instanceof HTMLElement)) {
|
||||
throw new Error("profile modal markup missing expected #profileModal root");
|
||||
}
|
||||
|
||||
this.modalContainer.appendChild(template.content);
|
||||
this.profileModal = modalRoot;
|
||||
|
||||
this.cacheDomReferences();
|
||||
this.registerEventListeners();
|
||||
|
||||
Reference in new issue
Block a user