Skip to content
Snippets Groups Projects
Commit d8e50fbd authored by Jérémie BRISON's avatar Jérémie BRISON Committed by Hugo SUBTIL
Browse files

fix: mobile responsive

parent b8da8e2e
No related branches found
No related tags found
2 merge requests!35Recette,!33Dev
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
[toogleToolTipId]="displayMarkerId" [toogleToolTipId]="displayMarkerId"
[selectedMarkerId]="selectedMarkerId" [selectedMarkerId]="selectedMarkerId"
(selectedStructure)="showDetailStructure($event)" (selectedStructure)="showDetailStructure($event)"
[isMapPhone]="isMapPhone"
class="right-pane" class="right-pane"
[ngClass]="{ mapPhone: isMapPhone == true }" [ngClass]="{ mapPhone: isMapPhone == true }"
></app-map> ></app-map>
......
...@@ -41,6 +41,7 @@ export class MapComponent implements OnChanges { ...@@ -41,6 +41,7 @@ export class MapComponent implements OnChanges {
@Input() public structures: Structure[] = []; @Input() public structures: Structure[] = [];
@Input() public toogleToolTipId: number; @Input() public toogleToolTipId: number;
@Input() public selectedMarkerId: number; @Input() public selectedMarkerId: number;
@Input() public isMapPhone: boolean;
@ViewChild(NgxLeafletLocateComponent, { static: false }) locateComponent: NgxLeafletLocateComponent; @ViewChild(NgxLeafletLocateComponent, { static: false }) locateComponent: NgxLeafletLocateComponent;
@Output() selectedStructure: EventEmitter<Structure> = new EventEmitter<Structure>(); @Output() selectedStructure: EventEmitter<Structure> = new EventEmitter<Structure>();
private currentStructure: Structure; private currentStructure: Structure;
...@@ -69,6 +70,13 @@ export class MapComponent implements OnChanges { ...@@ -69,6 +70,13 @@ export class MapComponent implements OnChanges {
} }
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes.isMapPhone) {
if (this.isMapPhone) {
setTimeout(() => {
this.map.invalidateSize();
}, 0);
}
}
if (changes.structures) { if (changes.structures) {
this.handleStructurePosition(changes.structures.previousValue); this.handleStructurePosition(changes.structures.previousValue);
} }
...@@ -80,7 +88,7 @@ export class MapComponent implements OnChanges { ...@@ -80,7 +88,7 @@ export class MapComponent implements OnChanges {
this.mapService.toogleToolTip(changes.toogleToolTipId.currentValue); this.mapService.toogleToolTip(changes.toogleToolTipId.currentValue);
} }
// Handle map marker selection // Handle map marker selection
if (changes.selectedMarkerId) { if (changes.selectedMarkerId && this.map) {
this.map.closePopup(); this.map.closePopup();
if (changes.selectedMarkerId.currentValue === undefined) { if (changes.selectedMarkerId.currentValue === undefined) {
this.mapService.setDefaultMarker(changes.selectedMarkerId.previousValue); this.mapService.setDefaultMarker(changes.selectedMarkerId.previousValue);
......
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
margin-left: 396px; margin-left: 396px;
} }
.modal { .modal {
max-height: 648px;
max-width: 754px; max-width: 754px;
width: 94%; width: 94%;
z-index: $modal-filter-structure-z-index !important; z-index: $modal-filter-structure-z-index !important;
position: absolute; position: fixed;
border-radius: 6px; border-radius: 6px;
margin-top: 3.5px; margin-top: 3.5px;
@media #{$large-phone} { @media #{$large-phone} {
height: 100%;
max-height: auto; max-height: auto;
max-width: auto; max-width: auto;
width: 100%; width: 100%;
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
.body-wrap { .body-wrap {
@media #{$large-phone} { @media #{$large-phone} {
height: 100vh; height: 100vh;
height: -webkit-fill-available;
} }
.titleFilter { .titleFilter {
display: none !important; display: none !important;
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
max-width: 1100px; max-width: 1100px;
border-bottom: 1px solid $grey; border-bottom: 1px solid $grey;
margin-bottom: 16px; margin-bottom: 16px;
max-height: 438px; max-height: 40vh;
@media #{$large-phone} { @media #{$large-phone} {
max-height: none; max-height: none;
height: 100%; height: 100%;
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
padding: 10px 24px; padding: 10px 24px;
overflow: auto; overflow: auto;
@media #{$tablet} { @media #{$tablet} {
width: calc(100% - 2 * 24px);
position: fixed; position: fixed;
padding: 0; height: 100%;
height: 100vh;
.printButton { .printButton {
display: none !important; display: none !important;
} }
...@@ -90,6 +90,7 @@ a { ...@@ -90,6 +90,7 @@ a {
height: unset; height: unset;
padding: unset; padding: unset;
overflow: hidden; overflow: hidden;
border-right: 0;
} }
.hide-on-print { .hide-on-print {
......
...@@ -6,13 +6,20 @@ ...@@ -6,13 +6,20 @@
@import 'assets/scss/icons'; @import 'assets/scss/icons';
@import '../node_modules/leaflet.locatecontrol/dist/L.Control.Locate.css'; @import '../node_modules/leaflet.locatecontrol/dist/L.Control.Locate.css';
html, html {
height: -webkit-fill-available;
margin: 0;
padding: 0;
background-color: $grey-6;
}
body { body {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
background-color: $grey-6; background-color: $grey-6;
min-height: 100vh;
min-height: -webkit-fill-available;
} }
a { a {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment