diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2019-01-01 22:18:11 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2019-01-01 22:18:11 -0500 |
commit | 018bd442ec1e04ba78a6628763414eb60b359398 (patch) | |
tree | 448cde462397af33e5a964ba5d0803b73c65040e /plugins/jetpack/modules/infinite-scroll/infinity.js | |
parent | Update easy-table 1.8 (diff) | |
download | blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.gz blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.tar.bz2 blogs-gentoo-018bd442ec1e04ba78a6628763414eb60b359398.zip |
Update jetpack 6.8.1
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/infinite-scroll/infinity.js')
-rw-r--r-- | plugins/jetpack/modules/infinite-scroll/infinity.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/infinite-scroll/infinity.js b/plugins/jetpack/modules/infinite-scroll/infinity.js index 010b7148..e1a508e4 100644 --- a/plugins/jetpack/modules/infinite-scroll/infinity.js +++ b/plugins/jetpack/modules/infinite-scroll/infinity.js @@ -486,6 +486,14 @@ Scroller.prototype.checkViewportOnLoad = function( ev ) { ev.data.self.ensureFilledViewport(); } +function fullscreenState() { + return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement + ? 1 + : 0; +} + +var previousFullScrenState = fullscreenState(); + /** * Identify archive page that corresponds to majority of posts shown in the current browser window. */ @@ -496,7 +504,20 @@ Scroller.prototype.determineURL = function () { windowSize = windowBottom - windowTop, setsInView = [], setsHidden = [], - pageNum = false; + pageNum = false, + currentFullScreenState = fullscreenState(); + + // xor - check if the state has changed + if ( previousFullScrenState ^ currentFullScreenState ) { + // If we just switched to/from fullscreen, + // don't do the div clearing/caching or the + // URL setting. Doing so can break video playback + // if the video goes to fullscreen. + + previousFullScrenState = currentFullScreenState; + return; + } + previousFullScrenState = currentFullScreenState; // Find out which sets are in view $( '.' + self.wrapperClass ).each( function() { |