mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
Added BitNode multipliers for purchased servers. Fixed bugs in new Script Editor implementation. Added documentation for script editors
This commit is contained in:
@@ -5,9 +5,15 @@ import { getElementById } from "./getElementById";
|
||||
* replacing. Then returns the new cloned element.
|
||||
* @param elemId The HTML ID to retrieve the element by.
|
||||
*/
|
||||
export function clearEventListeners(elemId: string): HTMLElement | null {
|
||||
export function clearEventListeners(elemId: string | HTMLElement): HTMLElement | null {
|
||||
try {
|
||||
const elem: HTMLElement = getElementById(elemId);
|
||||
let elem: HTMLElement;
|
||||
if (typeof elemId === "string") {
|
||||
elem = getElementById(elemId);
|
||||
} else {
|
||||
elem = elemId;
|
||||
}
|
||||
|
||||
const newElem: HTMLElement = elem.cloneNode(true) as HTMLElement;
|
||||
if (elem.parentNode !== null) {
|
||||
elem.parentNode.replaceChild(newElem, elem);
|
||||
|
||||
Reference in New Issue
Block a user