aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/MobileView.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/MobileView.hx')
-rw-r--r--src/client/MobileView.hx21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/client/MobileView.hx b/src/client/MobileView.hx
index ad788df..52d06f9 100644
--- a/src/client/MobileView.hx
+++ b/src/client/MobileView.hx
@@ -8,20 +8,19 @@ class MobileView {
public static function init():Void {
final mvbtn = ge("#mv_btn");
mvbtn.onclick = e -> {
- final mobileView = Utils.toggleFullScreen(document.documentElement);
- if (mobileView) {
- document.body.classList.add('mobile-view');
- mvbtn.classList.add('active');
- final vwrap = ge("#videowrap");
- if (vwrap.children[0] == ge("currenttitle")) {
+ final hasMobileView = Utils.toggleFullScreen(document.documentElement);
+ final vwrap = ge("#videowrap");
+ if (hasMobileView) {
+ document.body.classList.add("mobile-view");
+ mvbtn.classList.add("active");
+ if (vwrap.children[0].id == "currenttitle") {
vwrap.appendChild(vwrap.children[0]);
}
} else {
- document.body.classList.remove('mobile-view');
- mvbtn.classList.remove('active');
- final vwrap = ge("videowrap");
- if (vwrap.children[0] != ge("currenttitle")) {
- vwrap.insertBefore(vwrap.children[1],vwrap.children[0]);
+ document.body.classList.remove("mobile-view");
+ mvbtn.classList.remove("active");
+ if (vwrap.children[0].id != "currenttitle") {
+ vwrap.insertBefore(vwrap.children[1], vwrap.children[0]);
}
}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage