aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/editor.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor.mjs')
-rw-r--r--src/editor.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index 35b1949..6456293 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -183,6 +183,12 @@ cm.on("change", (_, change) => {
183 completeForCodeBlock(change) 183 completeForCodeBlock(change)
184}) 184})
185 185
186// Set class for focus
187cm.on("focus", () => {
188 cm.getWrapperElement().classList.add('focus')
189 HtmlContainer.classList.remove('focus')
190})
191
186cm.on("beforeChange", (_, change) => { 192cm.on("beforeChange", (_, change) => {
187 const line = change.to.line 193 const line = change.to.line
188 // Don't allow more content after YAML doc separator 194 // Don't allow more content after YAML doc separator
@@ -507,6 +513,8 @@ cm.on("cursorActivity", (_) => {
507}); 513});
508cm.on("blur", () => { 514cm.on("blur", () => {
509 suggestionsEle.style.display = 'none' 515 suggestionsEle.style.display = 'none'
516 cm.getWrapperElement().classList.remove('focus')
517 HtmlContainer.classList.add('focus')
510}) 518})
511// }}} 519// }}}
512// EVENT: keydown for suggestions {{{ 520// EVENT: keydown for suggestions {{{