Remove global pageContent.
This commit is contained in:
parent
499dabea24
commit
26c5bd0467
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue