Skip to content

Commit

Permalink
Update map width when toggling sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarchena committed Apr 25, 2024
1 parent 680ba61 commit f788700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ export default class ApplicationController extends Controller.extend(
toggleLeftSideMenuVisibility() {
this.leftSideMenuVisibilty = !this.leftSideMenuVisibilty;

const mapContainer = document.querySelector('.map-container');

if (this.leftSideMenuVisibilty)
mapContainer.setAttribute('class', 'map-container');
else mapContainer.setAttribute('class', 'map-container full-width');

this.metrics.trackEvent('MatomoTagManager', {
category: 'Toggled Layer Menu Visibility',
action: 'Toggled Layer Menu Visibility',
Expand Down
7 changes: 6 additions & 1 deletion app/styles/layouts/_l-default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ body {
@include breakpoint(xlarge) {
width: calc(100% - 18rem);
}

&.full-width {
width: 100%;
}

}

body.index {
Expand Down Expand Up @@ -193,7 +198,7 @@ body.index {
);
}

& > .close-button {
& .close-button {
position: relative;
margin: 0;

Expand Down

0 comments on commit f788700

Please sign in to comment.