aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editor.mjs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index ca8e6b0..fb73f93 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -13,6 +13,12 @@ const dumbyContainer = document.querySelector('.DumbyMap')
13const textArea = document.querySelector('.editor textarea') 13const textArea = document.querySelector('.editor textarea')
14let dumbymap 14let dumbymap
15 15
16/**
17 * Watch for changes of editing mode
18 *
19 * For 'data-mode' attribute of the context element, if the mode is 'editing'
20 * and the layout is not 'normal', it sets the layout to 'normal' and switch to editing mode
21 */
16new window.MutationObserver(() => { 22new window.MutationObserver(() => {
17 const mode = context.getAttribute('data-mode') 23 const mode = context.getAttribute('data-mode')
18 const layout = dumbyContainer.getAttribute('data-layout') 24 const layout = dumbyContainer.getAttribute('data-layout')