Skip to content

Commit

Permalink
Show legend only if it contains content when toggling settings or help
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardchalstrey1 committed Dec 16, 2024
1 parent 340c3fd commit 7396cf6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions seshat/apps/core/static/core/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,9 @@ function toggleSettings() {
map.zoomControl.enable();
map.scrollWheelZoom.enable();
// Show the legend and popup when the settings are closed
document.getElementById('variableLegend').style.display = 'block';
if (document.getElementById('variableLegend').innerHTML != '') {
document.getElementById('variableLegend').style.display = 'block';
}
document.getElementById('popup').style.display = 'block';
}
}
Expand All @@ -746,7 +748,6 @@ function closeSettings() {
// Show the legend and popup when the settings are closed
if (document.getElementById('variableLegend').innerHTML != '') {
document.getElementById('variableLegend').style.display = 'block';
console.log('got here 2');
}
document.getElementById('popup').style.display = 'block';
}
Expand Down Expand Up @@ -774,7 +775,9 @@ function toggleHelp() {
map.zoomControl.enable();
map.scrollWheelZoom.enable();
// Show the legend and popup when the help text is closed
document.getElementById('variableLegend').style.display = 'block';
if (document.getElementById('variableLegend').innerHTML != '') {
document.getElementById('variableLegend').style.display = 'block';
}
document.getElementById('popup').style.display = 'block';
}
}
Expand Down

0 comments on commit 7396cf6

Please sign in to comment.