diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-05-12 16:32:43 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-05-12 16:33:34 -0400 |
| commit | 21256f1fc48ee448626a32d6c41c077dfbaf0e02 (patch) | |
| tree | 9f2c371c95a1ed2abc401955aa976720cb19a6f2 /site/public/assets/javascripts/vendor/polyfill.js | |
| parent | 6355b85fc5cb6ad2bac4e3d40e1b550875adb22e (diff) | |
Add some polyfills + utils
Diffstat (limited to 'site/public/assets/javascripts/vendor/polyfill.js')
| -rw-r--r-- | site/public/assets/javascripts/vendor/polyfill.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/site/public/assets/javascripts/vendor/polyfill.js b/site/public/assets/javascripts/vendor/polyfill.js index 411d90f..8c26e80 100644 --- a/site/public/assets/javascripts/vendor/polyfill.js +++ b/site/public/assets/javascripts/vendor/polyfill.js @@ -97,4 +97,34 @@ function fullscreen (el) { } else if (el.webkitRequestFullscreen) { el.webkitRequestFullscreen(); } -}
\ No newline at end of file +} + +/* + * Proper fullscreen detection using the HTML5 + * Full Screen API. Not supported on mobile or + * IE10 and under + * TODO Need to disable fullscreen button on IE10 and lower + */ +function isFullScreen() { + return !!getFullScreenElement() +} + +function getFullScreenElement() { + return document.fullScreenElement || + document.webkitFullscreenElement || + document.mozFullScreenElement || + document.msFullscreenElement +} + +var raf = window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame + +var caf = window.cancelAnimationFrame || + window.webkitCancelAnimationFrame || + window.mozCancelAnimationFrame || + window.oCancelAnimationFrame || + window.msCancelAnimationFrame + |
