From 9596931d2736d14726eeaa2d518cb732d628d904 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 6 Oct 2024 15:14:33 +0800 Subject: style: jsdoc --- src/editor.mjs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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') const textArea = document.querySelector('.editor textarea') let dumbymap +/** + * Watch for changes of editing mode + * + * For 'data-mode' attribute of the context element, if the mode is 'editing' + * and the layout is not 'normal', it sets the layout to 'normal' and switch to editing mode + */ new window.MutationObserver(() => { const mode = context.getAttribute('data-mode') const layout = dumbyContainer.getAttribute('data-layout') -- cgit v1.2.3-70-g09d2