diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Layout.mjs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs index 23588a1..51caefb 100644 --- a/src/Layout.mjs +++ b/src/Layout.mjs | |||
| @@ -61,9 +61,15 @@ export class Overlay extends Layout { | |||
| 61 | addDraggable = (element) => { | 61 | addDraggable = (element) => { |
| 62 | // Make sure current element always on top | 62 | // Make sure current element always on top |
| 63 | const siblings = Array.from(element.parentElement?.querySelectorAll(':scope > *') ?? []) | 63 | const siblings = Array.from(element.parentElement?.querySelectorAll(':scope > *') ?? []) |
| 64 | let popTimer = null | ||
| 64 | element.onmouseover = () => { | 65 | element.onmouseover = () => { |
| 65 | siblings.forEach(e => e.style.removeProperty('z-index')) | 66 | popTimer = setTimeout(() => { |
| 66 | element.style.zIndex = '9000' | 67 | siblings.forEach(e => e.style.removeProperty('z-index')) |
| 68 | element.style.zIndex = '9000' | ||
| 69 | }, 200) | ||
| 70 | } | ||
| 71 | element.onmouseout = () => { | ||
| 72 | clearTimeout(popTimer) | ||
| 67 | } | 73 | } |
| 68 | 74 | ||
| 69 | // Add draggable part | 75 | // Add draggable part |