mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 10:42:51 +02:00
[refactor] Moved 'getElementById' to its own TS file.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { createElement } from "./createElement";
|
||||
import { getElementById } from "./getElementById";
|
||||
|
||||
/**
|
||||
* Creates the necessary DOM elements to present an in-game popup to the player.
|
||||
@@ -20,13 +21,8 @@ export function createPopup(id: string, elems: HTMLElement[]) {
|
||||
content.appendChild(elem);
|
||||
}
|
||||
container.appendChild(content);
|
||||
const gameContainer: HTMLElement | null = document.getElementById("entire-game-container");
|
||||
|
||||
if (gameContainer === null) {
|
||||
throw new Error("Unable to find the game container. Something is *seriously* wrong...");
|
||||
}
|
||||
|
||||
gameContainer.appendChild(container);
|
||||
getElementById("entire-game-container")
|
||||
.appendChild(container);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user