diff options
-rw-r--r-- | src/editor.mjs | 6 |
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') | |||
13 | const textArea = document.querySelector('.editor textarea') | 13 | const textArea = document.querySelector('.editor textarea') |
14 | let dumbymap | 14 | let 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 | */ | ||
16 | new window.MutationObserver(() => { | 22 | new 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') |