aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/MobileView.hx
blob: ad788dfddfc718e77cb323ac3ff2112ebda16678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package client;

import js.Browser.document;
import client.Main.ge;

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")) {
					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]);
				}
			}
		}
	}

}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage