aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/MobileView.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-02-24 01:19:30 +0300
committerRblSb <msrblsb@gmail.com>2020-02-24 01:19:30 +0300
commitc561fb9e2e42e4968f2b48cd535f208e90f8c12c (patch)
tree0c7e1ffc99744aabbb240864b371b9555a611d92 /src/client/MobileView.hx
parent113b06e895f5dc752e8393c2a4f3f1669a7d0aab (diff)
More playlist and video control
Diffstat (limited to 'src/client/MobileView.hx')
-rw-r--r--src/client/MobileView.hx23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/client/MobileView.hx b/src/client/MobileView.hx
index 976958b..ad788df 100644
--- a/src/client/MobileView.hx
+++ b/src/client/MobileView.hx
@@ -8,7 +8,7 @@ class MobileView {
public static function init():Void {
final mvbtn = ge("#mv_btn");
mvbtn.onclick = e -> {
- final mobileView = toggleFullScreen();
+ final mobileView = Utils.toggleFullScreen(document.documentElement);
if (mobileView) {
document.body.classList.add('mobile-view');
mvbtn.classList.add('active');
@@ -27,25 +27,4 @@ class MobileView {
}
}
- static function toggleFullScreen():Bool {
- var state = true;
- final doc:Dynamic = document;
- if (document.fullscreenElement == null &&
- doc.mozFullScreenElement == null &&
- doc.webkitFullscreenElement == null) {
- if (document.documentElement.requestFullscreen != null) {
- document.documentElement.requestFullscreen();
- } else if (doc.documentElement.mozRequestFullScreen != null) {
- doc.documentElement.mozRequestFullScreen();
- } else if (doc.documentElement.webkitRequestFullscreen != null) {
- doc.documentElement.webkitRequestFullscreen(untyped Element.ALLOW_KEYBOARD_INPUT);
- } else state = false;
- } else {
- if (doc.cancelFullScreen != null) doc.cancelFullScreen();
- else if (doc.mozCancelFullScreen != null) doc.mozCancelFullScreen();
- else if (doc.webkitCancelFullScreen != null) doc.webkitCancelFullScreen();
- state = false;
- }
- return state;
- }
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage