Clearing BreezeWiki options before populating

pull/161/head^2
Kevin Payravi 2023-06-29 02:24:05 -05:00
parent d57446c4f3
commit 0063c4aa7f
2 changed files with 16 additions and 0 deletions

View File

@ -51,6 +51,10 @@ async function loadBreezeWikiOptions() {
} }
// Populate dropdown selection of hosts // Populate dropdown selection of hosts
const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); const breezewikiHostSelect = document.getElementById('breezewikiHostSelect');
while (breezewikiHostSelect.firstChild) {
// Remove any existing options
breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild);
}
for (var i = 0; i < breezewikiHosts.length; i++) { for (var i = 0; i < breezewikiHosts.length; i++) {
let option = document.createElement('option'); let option = document.createElement('option');
option.value = breezewikiHosts[i].instance; option.value = breezewikiHosts[i].instance;
@ -84,6 +88,10 @@ async function loadBreezeWikiOptions() {
} }
// Populate dropdown selection of hosts // Populate dropdown selection of hosts
const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); const breezewikiHostSelect = document.getElementById('breezewikiHostSelect');
while (breezewikiHostSelect.firstChild) {
// Remove any existing options
breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild);
}
for (var i = 0; i < hostOptions.length; i++) { for (var i = 0; i < hostOptions.length; i++) {
let option = document.createElement('option'); let option = document.createElement('option');
option.value = hostOptions[i].instance; option.value = hostOptions[i].instance;

View File

@ -80,6 +80,10 @@ async function loadBreezeWikiOptions() {
} }
// Populate dropdown selection of hosts // Populate dropdown selection of hosts
const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); const breezewikiHostSelect = document.getElementById('breezewikiHostSelect');
while (breezewikiHostSelect.firstChild) {
// Remove any existing options
breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild);
}
for (var i = 0; i < breezewikiHosts.length; i++) { for (var i = 0; i < breezewikiHosts.length; i++) {
let option = document.createElement('option'); let option = document.createElement('option');
option.value = breezewikiHosts[i].instance; option.value = breezewikiHosts[i].instance;
@ -113,6 +117,10 @@ async function loadBreezeWikiOptions() {
} }
// Populate dropdown selection of hosts // Populate dropdown selection of hosts
const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); const breezewikiHostSelect = document.getElementById('breezewikiHostSelect');
while (breezewikiHostSelect.firstChild) {
// Remove any existing options
breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild);
}
for (var i = 0; i < hostOptions.length; i++) { for (var i = 0; i < hostOptions.length; i++) {
let option = document.createElement('option'); let option = document.createElement('option');
option.value = hostOptions[i].instance; option.value = hostOptions[i].instance;