aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-04-26 02:39:46 +0300
committerRblSb <msrblsb@gmail.com>2020-04-26 02:39:46 +0300
commit3c5fda212a8b895027c3853d9979b12a8f6c5798 (patch)
tree5a0fb8c332cc5f1eba3b54e65fbebf2242585a0a /src/client/Buttons.hx
parent40589f8e8ee75485ba241777f3b26cd35d8a05ea (diff)
Fix some issues with reused players
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx12
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");
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage