From ceaca6985e3a26e3edcf4c467f200127db064913 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Fri, 31 Jan 2014 10:48:57 +0100 Subject: [PATCH] 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 --- resources/jquery/jquery.fullscreen.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 ) ); -- 2.20.1