Skip to content

Commit c95d4e3

Browse files
committed
Remove indentation of input controls + better alignment in Style settings
1 parent b4f5afe commit c95d4e3

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/mapml.css

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,18 @@
203203
display: inline;
204204
}
205205

206-
.leaflet-control-layers-overlays > fieldset > .mapml-layer-item-settings > .mapml-control-layers > summary ~ * {
206+
.mapml-control-layers > :not(summary) {
207207
display: block;
208-
margin-top: 5px;
209-
margin-left: 15px;
210-
width: calc(100% - 15px);
208+
margin-block-start: 5px;
209+
width: 100%;
210+
}
211+
212+
.mapml-layer-item-style > div {
213+
display: flex;
214+
}
215+
216+
.mapml-layer-item-style input {
217+
margin-inline-start: 0;
211218
}
212219

213220
.leaflet-control-layers-list .leaflet-control-layers-overlays > :not(:last-of-type) {
@@ -692,9 +699,3 @@ label.mapml-layer-item-toggle {
692699
padding-inline-start: 2rem;
693700
padding-inline-end: 1rem;
694701
}
695-
696-
.mapml-layer-item-opacity [type="range"] {
697-
margin-inline-end: 0;
698-
margin-inline-start: 0;
699-
width: 100%;
700-
}

src/mapml/layers/MapLayer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ export var MapMLLayer = L.Layer.extend({
489489
layerItemSettings = L.DomUtil.create('div', 'mapml-layer-item-settings', fieldset),
490490
itemToggleLabel = L.DomUtil.create('label', 'mapml-layer-item-toggle', layerItemProperty),
491491
layerItemControls = L.DomUtil.create('div', 'mapml-layer-item-controls', layerItemProperty),
492-
opacityControl = L.DomUtil.create('details', 'mapml-layer-item-opacity', layerItemSettings),
492+
opacityControl = L.DomUtil.create('details', 'mapml-layer-item-opacity mapml-control-layers', layerItemSettings),
493493
opacity = L.DomUtil.create('input'),
494494
opacityControlSummary = L.DomUtil.create('summary'),
495495
svgSettingsControlIcon = L.SVG.create('svg'),
@@ -654,7 +654,7 @@ export var MapMLLayer = L.Layer.extend({
654654
// don't add it again if it is referenced > once
655655
if (mapmlInput.tagName.toLowerCase() === 'map-select' && !frag.querySelector(id)) {
656656
// generate a <details><summary></summary><select...></details>
657-
var selectdetails = L.DomUtil.create('details', 'mapml-control-layers', frag),
657+
var selectdetails = L.DomUtil.create('details', 'mapml-layer-item-time mapml-control-layers', frag),
658658
selectsummary = L.DomUtil.create('summary'),
659659
selectSummaryLabel = L.DomUtil.create('label');
660660
selectSummaryLabel.innerText = mapmlInput.getAttribute('name');
@@ -939,7 +939,7 @@ export var MapMLLayer = L.Layer.extend({
939939
};
940940

941941
for (var j=0;j<styleLinks.length;j++) {
942-
var styleOption = document.createElement('span'),
942+
var styleOption = document.createElement('div'),
943943
styleOptionInput = styleOption.appendChild(document.createElement('input'));
944944
styleOptionInput.setAttribute("type", "radio");
945945
styleOptionInput.setAttribute("id", "rad-"+L.stamp(styleOptionInput));
@@ -953,7 +953,7 @@ export var MapMLLayer = L.Layer.extend({
953953
styleOptionInput.checked = true;
954954
}
955955
stylesControl.appendChild(styleOption);
956-
L.DomUtil.addClass(stylesControl,'mapml-control-layers');
956+
L.DomUtil.addClass(stylesControl,'mapml-layer-item-style mapml-control-layers');
957957
L.DomEvent.on(styleOptionInput,'click', changeStyle, layer);
958958
}
959959
layer._styles = stylesControl;

0 commit comments

Comments
 (0)