Commit 86ea74e0 authored by Okhin's avatar Okhin

Coloring the selected country Issue #21

parent b601dae3
......@@ -17,6 +17,16 @@ $(document).ready(function() {
dataset[iso] = { numberOfCases: value, fillColor: paletteScale(value)};
});
/* We want to highlight a country if we've selected one */
var url_segments = window.location.pathname.split('/');
url_segments.pop(); //This one is empty
var country = url_segments.pop(),
page = url_segments.pop();
if (page === 'list') {
dataset[country] = {fillColor: '#02386F'};
}
$('#map').datamaps({
element: document.getElementById('map'),
scope: 'europe',
......@@ -48,7 +58,6 @@ $(document).ready(function() {
'</div>'].join('')
}
},
responsive: true;
done: function(datamap) {
datamap.svg.selectAll('.datamaps-subunit').on('click', function(geography) {
window.location='/list/'+geography.id+"/";
......
Markdown is supported
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