Skip to content

Commit

Permalink
move component legend scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardchalstrey1 committed Dec 16, 2024
1 parent 1d806be commit 6c8c7b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions seshat/apps/core/static/core/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,11 @@ function updateComponentLegend() {
// Make the polityContainer scrollable if there are more than 7 polities
if (addedPolities.length > 7) {
polityContainer.style.maxHeight = '300px';
polityContainer.style.overflowY = 'scroll';
polityContainer2.style.maxHeight = '300px';
polityContainer2.style.overflowY = 'scroll';
} else {
// Reset to default if fewer than 7 polities to ensure it behaves correctly on subsequent updates
polityContainer.style.maxHeight = '';
polityContainer.style.overflowY = '';
polityContainer2.style.maxHeight = '';
polityContainer2.style.overflowY = '';
}
} else {
// Hide the component legend if there are no components to display
Expand Down
10 changes: 8 additions & 2 deletions seshat/apps/core/templates/core/polity_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
background-color: rgba(255, 253, 242, 1);
padding: 10px;
border-radius: 5px;
max-width: 200px;
width: 200px;
max-width: 50%;
max-height: 60%;
overflow-y: auto;
z-index: 999;
}
#componentLegend2 {
Expand All @@ -70,7 +73,10 @@
background-color: rgba(255, 253, 242, 1);
padding: 10px;
border-radius: 5px;
max-width: 200px;
width: 200px;
max-width: 50%;
max-height: 60%;
overflow-y: auto;
z-index: 999;
}
.display-info-container {
Expand Down

0 comments on commit 6c8c7b2

Please sign in to comment.