Skip to content

Commit

Permalink
showImages conserveMemory: Don't unload when scrolling horizontally (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
larsjohnsen authored and erikdesjardins committed May 16, 2018
1 parent af2ea98 commit 0daa63d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/showImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ function enableConserveMemory() {
// $FlowIssue `mozFullScreenElement` is not recognized
const fullscreenActive = () => !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement: any);

const rootMargin = `${100 * (parseInt(module.options.bufferScreens.value, 10) || 2)}%`;
// x-axis is set to 100000% in order to not unload images when scrolling too far horizontally
const rootMargin = `${100 * (parseInt(module.options.bufferScreens.value, 10) || 2)}% 100000%`;

const mediaMap = new WeakMap();
const ioMedia = new IntersectionObserver(entries => {
Expand Down

0 comments on commit 0daa63d

Please sign in to comment.