From f5fe267ba9b1477db37922866d12d3c4defe9744 Mon Sep 17 00:00:00 2001 From: kor Date: Wed, 31 Oct 2018 12:55:51 +1300 Subject: [PATCH] Refactor masonry re-layout settings. --- docs/content/settings.js | 1 - docs/logic/view.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/content/settings.js b/docs/content/settings.js index 5bf67c7..d4c2111 100644 --- a/docs/content/settings.js +++ b/docs/content/settings.js @@ -4,7 +4,6 @@ const SETTINGS = STATSNUMTYPE: 10, WIDEGRIDITEM: true, USEMASONRY: true, - MASONRYCOMPLETE: true, MASONRYPROGRESS: true, GRIDITEMIDBASE: 'item', SHOWUPPER: true, diff --git a/docs/logic/view.js b/docs/logic/view.js index 42590c0..6272eb9 100644 --- a/docs/logic/view.js +++ b/docs/logic/view.js @@ -54,12 +54,12 @@ function View() if (SETTINGS.MASONRYCOMPLETE || SETTINGS.MASONRYPROGRESS) { let imgLoad = imagesLoaded( container ); - if (SETTINGS.MASONRYCOMPLETE) + if (!SETTINGS.MASONRYPROGRESS) { // When all images finish: redo mansonry layout imgLoad.on( 'always', function() { parent.msnry.layout(); } ); } - if (SETTINGS.MASONRYPROGRESS) + else { // As images load one by one: redo masonry layout imgLoad.on( 'progress', function() { parent.msnry.layout(); } );