[refactor] Moved 'removeElementById' to its own TS file

This commit is contained in:
Steven Evans
2018-07-05 13:36:02 -04:00
parent 488f947a5b
commit 875f7b4438
8 changed files with 31 additions and 17 deletions
-9
View File
@@ -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,