diff options
| author | RblSb <msrblsb@gmail.com> | 2020-02-24 01:19:30 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-02-24 01:19:30 +0300 |
| commit | c561fb9e2e42e4968f2b48cd535f208e90f8c12c (patch) | |
| tree | 0c7e1ffc99744aabbb240864b371b9555a611d92 /src/client/MobileView.hx | |
| parent | 113b06e895f5dc752e8393c2a4f3f1669a7d0aab (diff) | |
More playlist and video control
Diffstat (limited to 'src/client/MobileView.hx')
| -rw-r--r-- | src/client/MobileView.hx | 23 |
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; - } } |
