diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Layout.mjs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Layout.mjs b/src/Layout.mjs index 2f90278..0c992d7 100644 --- a/src/Layout.mjs +++ b/src/Layout.mjs | |||
| @@ -21,6 +21,7 @@ export class SideBySide extends Layout { | |||
| 21 | const handle = bar.querySelector('.bar-handle') | 21 | const handle = bar.querySelector('.bar-handle') |
| 22 | container.appendChild(bar) | 22 | container.appendChild(bar) |
| 23 | 23 | ||
| 24 | // Resize views by value | ||
| 24 | const resizeByLeft = (left) => { | 25 | const resizeByLeft = (left) => { |
| 25 | htmlHolder.style.width = (left) + "px" | 26 | htmlHolder.style.width = (left) + "px" |
| 26 | showcase.style.width = (parseFloat(getComputedStyle(container).width) - left) + "px" | 27 | showcase.style.width = (parseFloat(getComputedStyle(container).width) - left) + "px" |
| @@ -39,9 +40,7 @@ export class SideBySide extends Layout { | |||
| 39 | handle.removeAttribute('style') | 40 | handle.removeAttribute('style') |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | new ResizeObserver(() => { | 43 | onRemove(bar, () => draggable.remove()) |
| 43 | if (draggable) resizeByLeft(draggable.left) | ||
| 44 | }).observe(container); | ||
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | leaveHandler = ({ container }) => { | 46 | leaveHandler = ({ container }) => { |