diff options
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | src/css/index.css | 2 | ||||
| -rw-r--r-- | src/editor.mjs | 8 |
3 files changed, 6 insertions, 6 deletions
| @@ -21,7 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | </head> | 22 | </head> |
| 23 | 23 | ||
| 24 | <body data-layout="editing"> | 24 | <body data-mode="editing"> |
| 25 | <div class="DumbyMap"></div> | 25 | <div class="DumbyMap"></div> |
| 26 | <div class="editor"> | 26 | <div class="editor"> |
| 27 | <textarea></textarea> | 27 | <textarea></textarea> |
diff --git a/src/css/index.css b/src/css/index.css index 3b8a51f..dc4c2e8 100644 --- a/src/css/index.css +++ b/src/css/index.css | |||
| @@ -11,7 +11,7 @@ body { | |||
| 11 | width: 100%; | 11 | width: 100%; |
| 12 | height: 100vh; | 12 | height: 100vh; |
| 13 | 13 | ||
| 14 | &[data-layout="editing"] { | 14 | &[data-mode="editing"] { |
| 15 | display: flex; | 15 | display: flex; |
| 16 | align-items: stretch; | 16 | align-items: stretch; |
| 17 | gap: 0.5em; | 17 | gap: 0.5em; |
diff --git a/src/editor.mjs b/src/editor.mjs index 6d13816..897a0d1 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -10,10 +10,10 @@ const HtmlContainer = document.querySelector(".DumbyMap") | |||
| 10 | const textArea = document.querySelector(".editor textarea") | 10 | const textArea = document.querySelector(".editor textarea") |
| 11 | 11 | ||
| 12 | const toggleEditing = () => { | 12 | const toggleEditing = () => { |
| 13 | if (document.body.getAttribute("data-layout") === "editing") { | 13 | if (document.body.getAttribute("data-mode") === "editing") { |
| 14 | document.body.removeAttribute("data-layout") | 14 | document.body.removeAttribute("data-mode") |
| 15 | } else { | 15 | } else { |
| 16 | document.body.setAttribute("data-layout", "editing") | 16 | document.body.setAttribute("data-mode", "editing") |
| 17 | } | 17 | } |
| 18 | HtmlContainer.setAttribute("data-layout", "normal") | 18 | HtmlContainer.setAttribute("data-layout", "normal") |
| 19 | } | 19 | } |
| @@ -560,7 +560,7 @@ document.onkeydown = (e) => { | |||
| 560 | const layoutObserver = new MutationObserver(() => { | 560 | const layoutObserver = new MutationObserver(() => { |
| 561 | const layout = HtmlContainer.getAttribute('data-layout') | 561 | const layout = HtmlContainer.getAttribute('data-layout') |
| 562 | if (layout !== 'normal') { | 562 | if (layout !== 'normal') { |
| 563 | document.body.removeAttribute('data-layout') | 563 | document.body.removeAttribute('data-mode') |
| 564 | } | 564 | } |
| 565 | }) | 565 | }) |
| 566 | 566 | ||