aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Layout.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-09-22 15:03:56 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-09-22 15:03:56 +0800
commit66b9043665f85a3180d91a63d7cbacd82493c16b (patch)
tree3a1c9225f2623ce10f684a0f4b0d974a8b0dd4c5 /src/Layout.mjs
parent59663cdb0bea2c79aceabd5c222ff32d99fe8afc (diff)
feat(CSS): use class name to hide draggable block
Diffstat (limited to 'src/Layout.mjs')
-rw-r--r--src/Layout.mjs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs
index 0c992d7..2deef01 100644
--- a/src/Layout.mjs
+++ b/src/Layout.mjs
@@ -91,7 +91,7 @@ export class Overlay extends Layout {
91 91
92 // Close button 92 // Close button
93 draggableBlock.querySelector('#close').onclick = () => { 93 draggableBlock.querySelector('#close').onclick = () => {
94 draggableBlock.setAttribute("data-state", "hide") 94 draggableBlock.classList.add('hide')
95 } 95 }
96 // Plus/Minus font-size of content 96 // Plus/Minus font-size of content
97 draggableBlock.querySelector('#plus-font-size').onclick = () => { 97 draggableBlock.querySelector('#plus-font-size').onclick = () => {
@@ -107,11 +107,11 @@ export class Overlay extends Layout {
107 const utils = draggableBlock.querySelector('.utils') 107 const utils = draggableBlock.querySelector('.utils')
108 draggableInstance.onDragStart = () => { 108 draggableInstance.onDragStart = () => {
109 utils.style.opacity = 0 109 utils.style.opacity = 0
110 draggableBlock.setAttribute('data-state', 'on-drag') 110 draggableBlock.classList.add('drag')
111 } 111 }
112 draggableInstance.onDragEnd = () => { 112 draggableInstance.onDragEnd = () => {
113 utils.style = '' 113 utils.style = ''
114 draggableBlock.removeAttribute('data-state') 114 draggableBlock.classList.remove('drag')
115 } 115 }
116 116
117 // Reposition draggable instance when resized 117 // Reposition draggable instance when resized