From: Gilles Dubuc Date: Fri, 31 Jan 2014 09:48:57 +0000 (+0100) Subject: Add the ability to know if fullscreen is available X-Git-Tag: 1.31.0-rc.0~16994^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=ceaca6985e3a26e3edcf4c467f200127db064913;p=lhc%2Fweb%2Fwiklou.git Add the ability to know if fullscreen is available Not all browsers support fullscreen and for mmv we need to display/hide the fullscreen button accordingly Change-Id: I693477dfcadd168ae5930691750b709444eda644 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/152 Github: https://github.com/theopolisme/jquery-fullscreen/pull/6 --- diff --git a/resources/jquery/jquery.fullscreen.js b/resources/jquery/jquery.fullscreen.js index 01590790ed..3d1f29a668 100644 --- a/resources/jquery/jquery.fullscreen.js +++ b/resources/jquery/jquery.fullscreen.js @@ -118,11 +118,7 @@ * Return false if fullscreen is not supported. */ setupFullscreen = function () { - if ( document.fullscreenEnabled || - document.mozFullScreenEnabled || - document.webkitFullscreenEnabled || - document.msFullscreenEnabled - ) { + if ( $.support.fullscreen ) { // When the fullscreen mode is changed, trigger the // fullscreen events (and when exiting, // also remove the fullscreen class) @@ -173,4 +169,9 @@ return this; } }; + + $.support.fullscreen = document.fullscreenEnabled || + document.webkitFullscreenEnabled || + document.mozFullScreenEnabled || + document.msFullscreenEnabled; }( jQuery ) );