mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
[refactor] Moved 'removeElementById' to its own TS file
This commit is contained in:
@@ -48,14 +48,6 @@ function clearEventListenersEl(el) {
|
||||
return newElem;
|
||||
}
|
||||
|
||||
//Given its id, this function removes an element AND its children
|
||||
function removeElementById(id) {
|
||||
var elem = document.getElementById(id);
|
||||
if (elem == null) {return;}
|
||||
while(elem.firstChild) {elem.removeChild(elem.firstChild);}
|
||||
elem.parentNode.removeChild(elem);
|
||||
}
|
||||
|
||||
function removeElement(elem) {
|
||||
if (elem == null || !(elem instanceof Element)) {return;}
|
||||
while(elem.firstChild) {elem.removeChild(elem.firstChild);}
|
||||
@@ -147,7 +139,6 @@ export {sizeOfObject,
|
||||
printArray,
|
||||
powerOfTwo,
|
||||
clearEventListenersEl,
|
||||
removeElementById,
|
||||
removeElement,
|
||||
createAccordionElement,
|
||||
appendLineBreaks,
|
||||
|
||||
Reference in New Issue
Block a user