[refactor] Moved 'clearSelector' to its own TS file.

This commit is contained in:
Steven Evans
2018-07-09 13:57:21 -04:00
parent 9e26ee7858
commit af40252ee9
3 changed files with 12 additions and 9 deletions
+9
View File
@@ -0,0 +1,9 @@
/**
* Clears all <option> elements from a <select>.
* @param selector The <select> element
*/
export function clearSelector(selector: HTMLSelectElement) {
for (let i: number = selector.options.length - 1; i >= 0; i--) {
selector.remove(i);
}
}