Skip to content

Commit

Permalink
Merge pull request #381 from rl-institut/fix/hide_potential_layers_wh…
Browse files Browse the repository at this point in the history
…en_closing_sidepanel

Hide potential layers when closing sidepanel
  • Loading branch information
nesnoj authored Oct 9, 2023
2 parents 14171c5 + 6017e6a commit 3210a1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions digiplan/static/js/sliders.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ function checkMainPanelSlider(msg, data) {
}
}

function closeSidepanel(panelCloseBtn) {
panelCloseBtn.parentNode.parentNode.previousElementSibling.classList.remove('active', 'active-sidepanel');
hidePotentialLayers();
}

function showOrHidePotentialLayersOnMoreLabelClick(msg, moreLabel) {
const classes = ["active", "active-sidepanel"];
const show = moreLabel.classList.contains(classes[0]);
Expand Down
2 changes: 1 addition & 1 deletion digiplan/templates/widgets/sidepanel_close_btn.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
type="button"
class="sidepanel__close"
aria-label="Close"
onclick="this.parentNode.parentNode.previousElementSibling.classList.remove('active', 'active-sidepanel')">
onclick="closeSidepanel(this)">
</button>

0 comments on commit 3210a1f

Please sign in to comment.