Skip to content

Commit

Permalink
271230 To fix based on PR comments:
Browse files Browse the repository at this point in the history
- simplify the code
- remove unnecessary line of code(to add hidden)
  • Loading branch information
sufangl committed Feb 15, 2024
1 parent 407871d commit 330cff3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,7 @@ <h2>Enrichment</h2>
address.events.on("post-datasets-update", function() {
let countryListElement = options.elements.countryList;
let optionElements = countryListElement.getElementsByTagName("option")
for (index = optionElements.length - 1; index >= 0; index--) {
let optionElement = optionElements[index];
if (optionElement.innerText !== "Please select") {
optionElement.parentNode.removeChild(optionElement);
}
}
Array.from(optionElements).filter(option => option.innerText !== 'Please select').forEach(option => option.remove())

let countries = address.countryDropdown;
for (const country of countries) {
Expand Down Expand Up @@ -240,10 +235,7 @@ <h2>Enrichment</h2>
address.events.on("post-formatting-lookup", function(key, item) {
document.querySelector(".loader").classList.add("hidden");
document.querySelector("#validated-address-info").classList.add("hidden");

document.querySelector(".formatted-address").classList.remove("hidden");
document.querySelectorAll(".formatted-address").forEach(element => element.classList.remove("hidden"));

document.querySelector('.promptset').classList.add('hidden');

// Populate the metadata section with more details about this address
Expand Down Expand Up @@ -336,7 +328,6 @@ <h2>Enrichment</h2>
address.events.on("error-display", function (error) {
document.querySelector('.promptset').classList.add('hidden');
resetMetadata();
document.querySelector('.formatted-address').classList.add('hidden');
document.querySelectorAll('.formatted-address').forEach(element => element.classList.add('hidden'));

let errorElement = document.querySelector('.error-display');
Expand Down

0 comments on commit 330cff3

Please sign in to comment.