Skip to content

Commit

Permalink
Update legend.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jokd committed Dec 6, 2024
1 parent 1d4343b commit 2b13506
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/controls/legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const Legend = function Legend(options = {}) {
const setVisibleLayersViewActive = function setVisibleLayersViewActive(active) {
if (!visibleLayersControl) return;
visibleLayersViewActive = active;
overlaysCmp.readOverlays()

Check failure on line 226 in src/controls/legend.js

View workflow job for this annotation

GitHub Actions / lint

Missing semicolon
if (visibleLayersViewActive) {
document.getElementById(overlaysCmp.getId()).classList.add('hidden');
document.getElementById(visibleOverlaysCmp.getId()).classList.remove('hidden');
Expand All @@ -231,7 +232,10 @@ const Legend = function Legend(options = {}) {
visibleOverlaysCmp.dispatch('readOverlays');
document.getElementById(toolsCmp.getId()).classList.add('hidden');
} else {
document.getElementById(overlaysCmp.getId()).classList.remove('hidden');
const nrOverlays = overlaysCmp.readOverlays().length;
if(nrOverlays > 0){

Check failure on line 236 in src/controls/legend.js

View workflow job for this annotation

GitHub Actions / lint

Expected space(s) after "if"

Check failure on line 236 in src/controls/legend.js

View workflow job for this annotation

GitHub Actions / lint

Missing space before opening brace
document.getElementById(overlaysCmp.getId()).classList.remove('hidden');
}
document.getElementById(visibleOverlaysCmp.getId()).classList.add('hidden');
document.getElementById(showAllVisibleLayersButton.getId()).classList.add('hidden');
document.getElementById(showVisibleLayersButton.getId()).classList.remove('hidden');
Expand Down Expand Up @@ -720,8 +724,7 @@ const Legend = function Legend(options = {}) {
cls: 'flex column relative',
components: mainContainerComponents,
style: {
'max-height': `${maxHeight}px`,
width: 'min-content'
'max-height': `${maxHeight}px`
}
});

Expand Down

0 comments on commit 2b13506

Please sign in to comment.