Globe: Temporary fix for responsive sizing, Add correct margins top/bottom
All checks were successful
continuous-integration/drone/push Build is passing

- Ideally the globe would have to get the size within its container (.globe), set via CSS and not on the window
This commit is contained in:
2020-04-19 20:13:01 +02:00
parent 9220e6cf8d
commit 1cddc26625
7 changed files with 68 additions and 65 deletions

View File

@@ -111,23 +111,24 @@
/*
** Manipulate data
*/
if ($countries) {
// Replace each countrie's continent by the database
$countries.forEach(count => count.continent = $continents.find(cont => cont.id === count.continent.id))
if (process.browser) {
if ($countries) {
$countries.forEach(country => {
const matchingContinent = $continents.find(continent => continent.id === country.continent.id)
// Replace continent with request data
country.continent = matchingContinent
// Add countries to each continents
matchingContinent.countries = []
matchingContinent.countries.push(country)
})
}
// Push each country to its continent
$countries.forEach(country => {
const continent = $continents.find(cont => cont.id === country.continent.id)
continent.countries = []
if (!continent.countries.includes(country)) {
continent.countries.push(country)
}
})
}
// Replace each location's country by the database
if ($locations) {
$locations.forEach(loc => loc.country = $countries.find(cont => cont.id === loc.country.id))
if ($locations) {
// Replace each location's country with request data
$locations.forEach(location => {
location.country = $countries.find(country => country.id === location.country.id)
})
}
}
</script>