diff --git a/.gitignore b/.gitignore index 6895bf0..30c78ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules coverage +mochawesome-report diff --git a/public/js/script.js b/public/js/script.js index 21fd0e3..36d253b 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -29,10 +29,6 @@ export function formatGeoInfo(loc) { return str; } -export function showLocations(html) { - document.querySelector('#results').innerHTML = html; -} - export function locationError(err) { console.log('Error getting location', err); let message = ` @@ -47,7 +43,7 @@ export function locationError(err) { return `${message}`; } -export function populateResults(c) { +export function populateResults() { navigator.geolocation.getCurrentPosition( function (location) { const xhr = new XMLHttpRequest(); @@ -55,7 +51,7 @@ export function populateResults(c) { const json = JSON.parse(xhr.response); const html = formatResults(json); - return showLocations(html); + return (document.querySelector('#results').innerHTML = html); }; xhr.open( 'GET', @@ -68,7 +64,8 @@ export function populateResults(c) { xhr.send(); }, function (err) { - return showLocations(locationError(err)); + return (document.querySelector('#results').innerHTML = + locationError(err)); }, ); } diff --git a/src/script.js b/src/script.js index 21fd0e3..36d253b 100644 --- a/src/script.js +++ b/src/script.js @@ -29,10 +29,6 @@ export function formatGeoInfo(loc) { return str; } -export function showLocations(html) { - document.querySelector('#results').innerHTML = html; -} - export function locationError(err) { console.log('Error getting location', err); let message = ` @@ -47,7 +43,7 @@ export function locationError(err) { return `${message}`; } -export function populateResults(c) { +export function populateResults() { navigator.geolocation.getCurrentPosition( function (location) { const xhr = new XMLHttpRequest(); @@ -55,7 +51,7 @@ export function populateResults(c) { const json = JSON.parse(xhr.response); const html = formatResults(json); - return showLocations(html); + return (document.querySelector('#results').innerHTML = html); }; xhr.open( 'GET', @@ -68,7 +64,8 @@ export function populateResults(c) { xhr.send(); }, function (err) { - return showLocations(locationError(err)); + return (document.querySelector('#results').innerHTML = + locationError(err)); }, ); }