aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-06 15:14:33 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-06 19:52:04 +0800
commit9596931d2736d14726eeaa2d518cb732d628d904 (patch)
tree44f4d6ede1cde1ef60317a930a6b35cbaf5a4031
parent4b5378a3cbd7350a530bbac4c916f781b809f888 (diff)
style: jsdoc
-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')