diff options
Diffstat (limited to 'src/Layout.mjs')
-rw-r--r-- | src/Layout.mjs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs index c81225f..746dda2 100644 --- a/src/Layout.mjs +++ b/src/Layout.mjs | |||
@@ -78,7 +78,7 @@ export class Overlay extends Layout { | |||
78 | draggablePart.onmouseup = (e) => { | 78 | draggablePart.onmouseup = (e) => { |
79 | if (e.button === 1) { | 79 | if (e.button === 1) { |
80 | // Hide block with middle click | 80 | // Hide block with middle click |
81 | draggableBlock.setAttribute("data-hide", "true") | 81 | draggableBlock.setAttribute("data-state", "hide") |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
@@ -95,7 +95,7 @@ export class Overlay extends Layout { | |||
95 | 95 | ||
96 | // Close button | 96 | // Close button |
97 | draggableBlock.querySelector('#close').onclick = () => { | 97 | draggableBlock.querySelector('#close').onclick = () => { |
98 | draggableBlock.setAttribute("data-hide", "true") | 98 | draggableBlock.setAttribute("data-state", "hide") |
99 | } | 99 | } |
100 | // Plus/Minus font-size of content | 100 | // Plus/Minus font-size of content |
101 | draggableBlock.querySelector('#plus-font-size').onclick = () => { | 101 | draggableBlock.querySelector('#plus-font-size').onclick = () => { |
@@ -106,12 +106,16 @@ export class Overlay extends Layout { | |||
106 | const fontSize = parseFloat(getComputedStyle(block).fontSize) / 16 | 106 | const fontSize = parseFloat(getComputedStyle(block).fontSize) / 16 |
107 | block.style.fontSize = `${fontSize - 0.1}rem` | 107 | block.style.fontSize = `${fontSize - 0.1}rem` |
108 | } | 108 | } |
109 | |||
110 | // FIXME use pure CSS to hide utils | ||
109 | const utils = draggableBlock.querySelector('.utils') | 111 | const utils = draggableBlock.querySelector('.utils') |
110 | draggableInstance.onDragStart = () => { | 112 | draggableInstance.onDragStart = () => { |
111 | utils.style.opacity = 0 | 113 | utils.style.opacity = 0 |
114 | draggableBlock.setAttribute('data-state', 'on-drag') | ||
112 | } | 115 | } |
113 | draggableInstance.onDragEnd = () => { | 116 | draggableInstance.onDragEnd = () => { |
114 | utils.style = '' | 117 | utils.style = '' |
118 | draggableBlock.removeAttribute('data-state') | ||
115 | } | 119 | } |
116 | 120 | ||
117 | // Reposition draggable instance when resized | 121 | // Reposition draggable instance when resized |