aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Layout.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Layout.mjs')
-rw-r--r--src/Layout.mjs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs
index 746dda2..2f90278 100644
--- a/src/Layout.mjs
+++ b/src/Layout.mjs
@@ -44,10 +44,7 @@ export class SideBySide extends Layout {
44 }).observe(container); 44 }).observe(container);
45 } 45 }
46 46
47 leaveHandler = ({ container, htmlHolder, showcase }) => { 47 leaveHandler = ({ container }) => {
48 container.removeAttribute('style')
49 htmlHolder.removeAttribute('style')
50 showcase.removeAttribute('style')
51 container.querySelector('.bar')?.remove() 48 container.querySelector('.bar')?.remove()
52 } 49 }
53} 50}
@@ -95,7 +92,7 @@ export class Overlay extends Layout {
95 92
96 // Close button 93 // Close button
97 draggableBlock.querySelector('#close').onclick = () => { 94 draggableBlock.querySelector('#close').onclick = () => {
98 draggableBlock.setAttribute("data-state", "hide") 95 draggableBlock.setAttribute("data-state", "hide")
99 } 96 }
100 // Plus/Minus font-size of content 97 // Plus/Minus font-size of content
101 draggableBlock.querySelector('#plus-font-size').onclick = () => { 98 draggableBlock.querySelector('#plus-font-size').onclick = () => {
@@ -149,16 +146,15 @@ export class Overlay extends Layout {
149 } 146 }
150 }) 147 })
151 } 148 }
152 leaveHandler = (dumbymap) => { 149
153 const container = dumbymap.htmlHolder 150 leaveHandler = ({ htmlHolder, blocks }) => {
154 const resumeFromDraggable = (block) => { 151 const resumeFromDraggable = (block) => {
155 const draggableContainer = block.closest('.draggable-block') 152 const draggableContainer = block.closest('.draggable-block')
156 if (!draggableContainer) return 153 if (!draggableContainer) return
157 container.appendChild(block) 154 htmlHolder.appendChild(block)
158 block.removeAttribute('style')
159 draggableContainer.remove() 155 draggableContainer.remove()
160 } 156 }
161 dumbymap.blocks.forEach(resumeFromDraggable) 157 blocks.forEach(resumeFromDraggable)
162 } 158 }
163} 159}
164 160