aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-01 11:33:22 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-01 12:30:07 +0800
commit312da714f8fc56d2f4ddbbc0a9759bf19b9c81d4 (patch)
treeaf5f0f6a3c8f58ddca3d07f7593465bb9f2e951b
parent5cfa03b77bf21982d5024aad09f1a89871fc127b (diff)
style: change owner of [data-mode]
-rw-r--r--src/editor.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/editor.mjs b/src/editor.mjs
index a7bdd77..20bcc2a 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -12,12 +12,12 @@ let dumbymap;
12 12
13new MutationObserver(() => { 13new MutationObserver(() => {
14 if ( 14 if (
15 document.body.getAttribute('data-mode') === 'editing' && 15 document.querySelector('[data-mode]').getAttribute('data-mode') === 'editing' &&
16 HtmlContainer.getAttribute('data-layout') !== 'normal' 16 HtmlContainer.getAttribute('data-layout') !== 'normal'
17 ) { 17 ) {
18 HtmlContainer.setAttribute('data-layout', 'normal'); 18 HtmlContainer.setAttribute('data-layout', 'normal');
19 } 19 }
20}).observe(document.body, { 20}).observe(document.querySelector('[data-mode]'), {
21 attributes: true, 21 attributes: true,
22 attributeFilter: ['data-mode'], 22 attributeFilter: ['data-mode'],
23}); 23});