1
0
Fork 0

Remove global pageContent.

This commit is contained in:
Kitteh 2021-05-16 13:40:39 +01:00
parent 499dabea24
commit 26c5bd0467
4 changed files with 3 additions and 11 deletions

View file

@ -32,12 +32,6 @@ import i18next from "i18next";
// @ts-ignore
import translations from "./translations/index.mjs";
declare global {
interface Window {
pageContent: Element;
}
}
async function onLoad(): Promise<void> {
document.body.innerHTML = "";
document.body.appendChild(makeElement({ tag: "div", id: "navBarReplace" }));
@ -64,8 +58,6 @@ async function onLoad(): Promise<void> {
}),
);
window.pageContent = document.querySelector("#pageContent");
const pageRouter = new PageRouter(
pageList,
pageState,

View file

@ -106,7 +106,7 @@ export class TransitDecryptPage extends Page {
i18next.t("transit_decrypt_decryption_result_modal_title"),
plaintext,
);
document.body.querySelector("#pageContent").appendChild(modal);
this.router.pageContentElement.appendChild(modal);
modal.show();
} catch (e: unknown) {
const error = e as Error;

View file

@ -104,7 +104,7 @@ export class TransitEncryptPage extends Page {
i18next.t("transit_encrypt_encryption_result_modal_title"),
res.ciphertext,
);
document.body.querySelector("#pageContent").appendChild(modal);
this.router.pageContentElement.appendChild(modal);
modal.show();
} catch (e: unknown) {
const error = e as Error;

View file

@ -97,7 +97,7 @@ export class TransitRewrapPage extends Page {
key_version: parseInt(formData.get("version") as string, 10),
});
const modal = CopyableModal(i18next.t("transit_rewrap_result_modal_title"), res.ciphertext);
document.body.querySelector("#pageContent").appendChild(modal);
this.router.pageContentElement.appendChild(modal);
modal.show();
} catch (e: unknown) {
const error = e as Error;