diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dumbymap.mjs | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs index f5cab8e..46682c9 100644 --- a/src/dumbymap.mjs +++ b/src/dumbymap.mjs | |||
@@ -126,13 +126,11 @@ export const markdown2HTML = (container, mdContent) => { | |||
126 | 126 | ||
127 | const contentWithToc = '${toc}\n\n\n' + mdContent | 127 | const contentWithToc = '${toc}\n\n\n' + mdContent |
128 | htmlHolder.innerHTML = md.render(contentWithToc); | 128 | htmlHolder.innerHTML = md.render(contentWithToc); |
129 | |||
129 | // TODO Do this in markdown-it | 130 | // TODO Do this in markdown-it |
130 | htmlHolder.querySelectorAll('*> div:not(:has(nav))') | 131 | htmlHolder.querySelectorAll('* > div:not(:has(nav))') |
131 | .forEach(b => b.classList.add('draggable-block')) | 132 | .forEach(b => b.classList.add('draggable-block')) |
132 | 133 | ||
133 | |||
134 | // TODO Improve it! | ||
135 | |||
136 | return container | 134 | return container |
137 | //}}} | 135 | //}}} |
138 | } | 136 | } |
@@ -156,14 +154,6 @@ export const generateMaps = async (container) => { | |||
156 | } | 154 | } |
157 | }) | 155 | }) |
158 | 156 | ||
159 | // Set focusArea | ||
160 | const showcase = document.createElement('div') | ||
161 | container.appendChild(showcase) | ||
162 | showcase.classList.add('Showcase') | ||
163 | const mapPlaceholder = document.createElement('div') | ||
164 | mapPlaceholder.id = 'mapPlaceholder' | ||
165 | showcase.appendChild(mapPlaceholder) | ||
166 | |||
167 | const isAnchorPointedBy = (link) => (anchor) => { | 157 | const isAnchorPointedBy = (link) => (anchor) => { |
168 | const mapContainer = anchor.closest('.map-container') | 158 | const mapContainer = anchor.closest('.map-container') |
169 | const isTarget = !link.targets || link.targets.includes(mapContainer.id) | 159 | const isTarget = !link.targets || link.targets.includes(mapContainer.id) |
@@ -304,6 +294,15 @@ export const generateMaps = async (container) => { | |||
304 | 294 | ||
305 | //}}} | 295 | //}}} |
306 | // CSS observer {{{ | 296 | // CSS observer {{{ |
297 | |||
298 | // Set focusArea | ||
299 | const showcase = document.createElement('div') | ||
300 | container.appendChild(showcase) | ||
301 | showcase.classList.add('Showcase') | ||
302 | const mapPlaceholder = document.createElement('div') | ||
303 | mapPlaceholder.id = 'mapPlaceholder' | ||
304 | showcase.appendChild(mapPlaceholder) | ||
305 | |||
307 | // Layout{{{ | 306 | // Layout{{{ |
308 | 307 | ||
309 | // press key to switch layout | 308 | // press key to switch layout |