Skip to content

Commit 5e598e9

Browse files
abelsimonnAbel Simon
and
Abel Simon
authored
fix: map block selection and styling (#159)
* fix: map block selection and styling * fix: lint --------- Co-authored-by: Abel Simon <[email protected]>
1 parent 4690370 commit 5e598e9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

blocks/map/map.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
padding: 0
4747
}
4848

49-
#map-default-content-wrapper > div > h2 {
49+
#map-default-content-wrapper > h2 {
5050
font-weight: var(--calcite-font-weight-normal);
5151
margin: 0 0 var(--space-4);
5252
line-height: 1.375;

blocks/map/map.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ const getMapFrame = (url) => {
3535

3636
export default function decorate(block) {
3737
const blockParams = block.querySelectorAll('p');
38-
39-
const textParameter = blockParams[0].innerText;
38+
const heading = block.querySelector('h2');
39+
const blockText = blockParams[0].innerText;
4040
const mapLink = blockParams[1].innerText;
4141
block.textContent = '';
4242

4343
const gridContainer = div({ class: 'grid-container' });
4444
const frameWrapper = div({ id: 'frame-wrapper' });
4545

46-
const defaultContentContainer = document.querySelector('.map-container > .default-content-wrapper');
46+
const defaultContentContainer = div();
4747
const nodeTextParam = p({ id: 'map-text-content' });
48-
nodeTextParam.textContent = textParameter;
48+
nodeTextParam.textContent = blockText;
4949
const hr = horizontalRule({ class: 'separator center' });
5050

51-
const contentWrapperChildren = [defaultContentContainer, hr, nodeTextParam];
51+
const contentWrapperChildren = [defaultContentContainer, heading, hr, nodeTextParam];
5252
const defaultContentWrapper = div({ id: 'map-default-content-wrapper' });
5353

5454
contentWrapperChildren.forEach((child) => {

0 commit comments

Comments
 (0)