Set borders and spacing for control groups directly in js

Previous stylesheet code is more complicated.
This commit is contained in:
Anton Khorev 2022-09-19 18:50:04 +03:00
parent 7904b49bb1
commit 6acb032d4c
2 changed files with 8 additions and 19 deletions

View file

@ -109,8 +109,14 @@ $(document).ready(function () {
control.addTo(map);
});
var lastContainer = controls[controls.length -1].getContainer();
$(lastContainer).addClass("leaflet-control-group-end");
var firstContainer = controls[0].getContainer();
$(firstContainer).find(".control-button").first()
.css("border-start-start-radius", "4px");
var lastContainer = controls[controls.length - 1].getContainer();
$(lastContainer).find(".control-button").last()
.css("margin-bottom", "10px")
.css("border-end-start-radius", "4px");
}
addControlGroup([

View file

@ -381,23 +381,6 @@ body.small-nav {
}
}
.leaflet-control-group-end + .leaflet-control {
padding-top: 10px;
}
.leaflet-control:first-child,
.leaflet-control-group-end + .leaflet-control {
&.control-button, .control-button:first-child {
border-start-start-radius: 4px;
}
}
.leaflet-control-group-end {
&.control-button, .control-button:last-child {
border-end-start-radius: 4px;
}
}
/* Rules for the sidebar and main map area */
.map-layout {