Remove global pageContent.
This commit is contained in:
parent
499dabea24
commit
26c5bd0467
|
@ -32,12 +32,6 @@ import i18next from "i18next";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import translations from "./translations/index.mjs";
|
import translations from "./translations/index.mjs";
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
pageContent: Element;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onLoad(): Promise<void> {
|
async function onLoad(): Promise<void> {
|
||||||
document.body.innerHTML = "";
|
document.body.innerHTML = "";
|
||||||
document.body.appendChild(makeElement({ tag: "div", id: "navBarReplace" }));
|
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(
|
const pageRouter = new PageRouter(
|
||||||
pageList,
|
pageList,
|
||||||
pageState,
|
pageState,
|
||||||
|
|
|
@ -106,7 +106,7 @@ export class TransitDecryptPage extends Page {
|
||||||
i18next.t("transit_decrypt_decryption_result_modal_title"),
|
i18next.t("transit_decrypt_decryption_result_modal_title"),
|
||||||
plaintext,
|
plaintext,
|
||||||
);
|
);
|
||||||
document.body.querySelector("#pageContent").appendChild(modal);
|
this.router.pageContentElement.appendChild(modal);
|
||||||
modal.show();
|
modal.show();
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
const error = e as Error;
|
const error = e as Error;
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class TransitEncryptPage extends Page {
|
||||||
i18next.t("transit_encrypt_encryption_result_modal_title"),
|
i18next.t("transit_encrypt_encryption_result_modal_title"),
|
||||||
res.ciphertext,
|
res.ciphertext,
|
||||||
);
|
);
|
||||||
document.body.querySelector("#pageContent").appendChild(modal);
|
this.router.pageContentElement.appendChild(modal);
|
||||||
modal.show();
|
modal.show();
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
const error = e as Error;
|
const error = e as Error;
|
||||||
|
|
|
@ -97,7 +97,7 @@ export class TransitRewrapPage extends Page {
|
||||||
key_version: parseInt(formData.get("version") as string, 10),
|
key_version: parseInt(formData.get("version") as string, 10),
|
||||||
});
|
});
|
||||||
const modal = CopyableModal(i18next.t("transit_rewrap_result_modal_title"), res.ciphertext);
|
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();
|
modal.show();
|
||||||
} catch (e: unknown) {
|
} catch (e: unknown) {
|
||||||
const error = e as Error;
|
const error = e as Error;
|
||||||
|
|
Loading…
Reference in a new issue