Skip to content

Commit 0e040ab

Browse files
committed
Improve control layout and description spacing.
1 parent c0fa1c0 commit 0e040ab

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

OpenMapSamplesControl.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
padding: 0.5em;
88
min-width: 10em;
99
min-height: 10em;
10+
max-width: 25em;
1011
}
1112

1213
.openmapsamples-control-button {
@@ -27,3 +28,11 @@
2728
.openmapsamples-control-samples-menu {
2829
min-width: 15em;
2930
}
31+
32+
.openmapsamples-sample-controls {
33+
margin-top: 0.5em;
34+
}
35+
36+
.openmapsamples-sample-description {
37+
margin-top: 1em;
38+
}

OpenMapSamplesControl.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ export default class SampleControl {
226226

227227
displaySample(sample) {
228228
this._sampleControls.innerHTML = '';
229-
var description = document.createElement('div');
230-
description.className = 'openmapsamples-sample-description';
231-
description.innerHTML = sample.getDescription();
232-
this._sampleControls.appendChild(description);
233229

234230
var label = document.createElement('label');
235231
label.htmlFor = 'openmapsamples-variant-select';
@@ -267,6 +263,11 @@ export default class SampleControl {
267263
this._nextVariantButton.onclick = this.incrementVariant.bind(this, sample);
268264
this._sampleControls.appendChild(this._nextVariantButton);
269265

266+
var description = document.createElement('div');
267+
description.className = 'openmapsamples-sample-description';
268+
description.innerHTML = sample.getDescription();
269+
this._sampleControls.appendChild(description);
270+
270271
// Save default source data and replace with sample data.
271272
this.restoreOriginalStyle();
272273
this.saveOriginalStyle();

0 commit comments

Comments
 (0)