From 5d4e12e3b961f6035dd567e24b3a6e8de258dc78 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 1 Nov 2013 10:06:59 -0700 Subject: [PATCH] Fullscreen support for IE 11 Support "ms"-prefixed fullscreen API in IE 11. Bug: 56470 Change-Id: I7647433c12314ac34f3fcd6d03e7d4da6893a7ee --- js/multilightbox/lightboxinterface.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/multilightbox/lightboxinterface.js b/js/multilightbox/lightboxinterface.js index eb4d79669..375cf613e 100644 --- a/js/multilightbox/lightboxinterface.js +++ b/js/multilightbox/lightboxinterface.js @@ -13,7 +13,8 @@ if ( !lbinterface.fullscreenButtonJustPressed && !document.fullscreenElement && !document.mozFullScreenElement && - !document.webkitFullScreenElement ) { + !document.webkitFullScreenElement && + !document.msFullScreenElement) { lbinterface.fullscreen(); } else if ( lbinterface.fullscreenButtonJustPressed ) { lbinterface.fullscreenButtonJustPressed = false; @@ -72,6 +73,7 @@ window.addEventListener( 'fullscreenchange', handleFullscreenChange ); window.addEventListener( 'mozfullscreenchange', handleFullscreenChange ); window.addEventListener( 'webkitfullscreenchange', handleFullscreenChange ); + window.addEventListener( 'msfullscreenchange', handleFullscreenChange ); } LIP = LightboxInterface.prototype; @@ -101,13 +103,16 @@ if ( this.isFullScreen ) { if ( !document.fullscreenElement && !document.mozFullScreenElement && - !document.webkitFullScreenElement ) { + !document.webkitFullScreenElement && + !document.msFullScreenElement ) { if ( document.cancelFullScreen ) { document.cancelFullScreen(); } else if ( document.mozCancelFullScreen ) { document.mozCancelFullScreen(); } else if ( document.webkitCancelFullScreen ) { document.webkitCancelFullScreen(); + } else if ( document.msCancelFullScreen ) { + document.msCancelFullScreen(); } } @@ -130,6 +135,8 @@ fullscreen.mozRequestFullScreen(); } else if ( fullscreen.webkitRequestFullScreen ) { fullscreen.webkitRequestFullScreen(); + } else if ( fullscreen.msRequestFullscreen ) { + fullscreen.msRequestFullscreen(); } lightboxHooks.callAll( 'fullscreen', this );