diff options
Diffstat (limited to 'src/client/Buttons.hx')
| -rw-r--r-- | src/client/Buttons.hx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx index 8a1264e..a7dd4e1 100644 --- a/src/client/Buttons.hx +++ b/src/client/Buttons.hx @@ -262,8 +262,16 @@ class Buttons { final swapLayoutBtn = ge("#swapLayoutBtn"); swapLayoutBtn.onclick = e -> { final p = ge("#main"); - p.insertBefore(p.children[2], p.children[0]); - p.insertBefore(p.children[2], p.children[1]); + if (ge("#main").firstElementChild == ge("#chatwrap")) { + // do not remove videowrap with insertBefore + // because this will recreate iframe-based players + p.appendChild(p.removeChild(p.children[1])); // gutter + p.appendChild(p.removeChild(p.children[0])); // chat + p.appendChild(p.removeChild(p.children[1])); // clear + } else { + p.insertBefore(p.children[2], p.children[0]); + p.insertBefore(p.children[2], p.children[1]); + } final p = ge("#controlsrow"); p.insertBefore(p.children[1], p.children[0]); final p = ge("#playlistrow"); |
