diff options
Diffstat (limited to 'src/editor.mjs')
-rw-r--r-- | src/editor.mjs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index 539a770..ab5db42 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
@@ -1,6 +1,6 @@ | |||
1 | /*global EasyMDE*/ | 1 | /*global EasyMDE*/ |
2 | /*eslint no-undef: "error"*/ | 2 | /*eslint no-undef: "error"*/ |
3 | import { markdown2HTML, generateMaps, createDocLinks } from './dumbymap' | 3 | import { markdown2HTML, generateMaps } from './dumbymap' |
4 | import { defaultAliases, parseConfigsFromYaml } from 'mapclay' | 4 | import { defaultAliases, parseConfigsFromYaml } from 'mapclay' |
5 | import { Suggestion } from './MenuItem' | 5 | import { Suggestion } from './MenuItem' |
6 | 6 | ||
@@ -88,11 +88,17 @@ if (contentFromHash) { | |||
88 | editor.cleanup() | 88 | editor.cleanup() |
89 | editor.value(contentFromHash) | 89 | editor.value(contentFromHash) |
90 | } | 90 | } |
91 | |||
92 | // }}} | 91 | // }}} |
93 | // Set up logic about editor content {{{ | 92 | // Set up logic about editor content {{{ |
93 | const afterMapRendered = (_) => { | ||
94 | // mapHolder.oncontextmenu = (event) => { | ||
95 | // event.preventDefault() | ||
96 | // const lonLat = mapHolder.renderer.unproject([event.x, event.y]) | ||
97 | // // TODO... | ||
98 | // } | ||
99 | } | ||
94 | markdown2HTML(HtmlContainer, editor.value()) | 100 | markdown2HTML(HtmlContainer, editor.value()) |
95 | createDocLinks(HtmlContainer) | 101 | dumbymap = generateMaps(HtmlContainer, afterMapRendered) |
96 | 102 | ||
97 | // Quick hack to style lines inside code block | 103 | // Quick hack to style lines inside code block |
98 | const addClassToCodeLines = () => { | 104 | const addClassToCodeLines = () => { |
@@ -159,17 +165,8 @@ const debounceForMap = (() => { | |||
159 | } | 165 | } |
160 | })() | 166 | })() |
161 | 167 | ||
162 | const afterMapRendered = (_) => { | ||
163 | // mapHolder.oncontextmenu = (event) => { | ||
164 | // event.preventDefault() | ||
165 | // const lonLat = mapHolder.renderer.unproject([event.x, event.y]) | ||
166 | // // TODO... | ||
167 | // } | ||
168 | } | ||
169 | |||
170 | const updateDumbyMap = () => { | 168 | const updateDumbyMap = () => { |
171 | markdown2HTML(HtmlContainer, editor.value()) | 169 | markdown2HTML(HtmlContainer, editor.value()) |
172 | createDocLinks(HtmlContainer) | ||
173 | // TODO Test if generate maps intantly is OK with map cache | 170 | // TODO Test if generate maps intantly is OK with map cache |
174 | // debounceForMap(HtmlContainer, afterMapRendered) | 171 | // debounceForMap(HtmlContainer, afterMapRendered) |
175 | dumbymap = generateMaps(HtmlContainer, afterMapRendered) | 172 | dumbymap = generateMaps(HtmlContainer, afterMapRendered) |