Commit beac5cc2 authored by Michał Woźniak's avatar Michał Woźniak
Browse files

six sites max please

parent 630cce09
Pipeline #122 passed with stage
in 0 seconds
......@@ -795,7 +795,7 @@ let getSiteCases = (site) => {
if ( ! ( site in siteData ) ) {
siteData[site] = {}
}
siteData[site] = {...siteData[site], ...site_data }
siteData[site] = { ...siteData[site], ...site_data }
// return it
return site_data
})
......@@ -1256,7 +1256,7 @@ document.addEventListener('DOMContentLoaded', (e)=>{
var newSite = sitesSelects[0].parentElement.parentElement.cloneNode(true)
newSite.getElementsByClassName('site-data')[0].innerHTML="";
// append the copied node to the `#sites-data-container` element
sitesSelects[0].parentElement.parentElement.parentElement.appendChild(newSite)
sitesSelects[0].parentElement.parentElement.parentElement.insertBefore(newSite, addSite.parentElement)
// for some reason sitesSelects auto-updates and always contains the full list
// of `.sites-select` elements. *magic*
sitesSelects[sitesSelects.length - 1].addEventListener('change', selectSite);
......
......@@ -159,7 +159,6 @@
color: springgreen;
}
#add-site-container {
order:99;
width:0px;
height:0px;
}
......@@ -179,6 +178,9 @@
#add-site.visible {
display: inline-block;
}
.site-data-container:nth-of-type(6) + #add-site-container > #add-site {
display:none;
}
#the-chart {
height:50vh;
}
......@@ -228,7 +230,6 @@
</div>
<div class="sources"><a href="https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic">source</a></div>
<div id="sites-data-container">
<div id="add-site-container"><a href="#add-site" id="add-site">+</a></div>
<div class="site-data-container">
<h2><select class="sites-select" tabindex="1">
<option value="select one">(select an area)</option>
......@@ -236,6 +237,7 @@
<div class="site-data">
</div>
</div>
<div id="add-site-container"><a href="#add-site" id="add-site">+</a></div>
</div>
<div id="the-chart-container">
<canvas id="the-chart"></canvas>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment