From c561fb9e2e42e4968f2b48cd535f208e90f8c12c Mon Sep 17 00:00:00 2001 From: RblSb Date: Mon, 24 Feb 2020 01:19:30 +0300 Subject: More playlist and video control --- src/client/MobileView.hx | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/client/MobileView.hx') 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; - } } -- cgit v1.2.3