Refactor masonry re-layout settings.

This commit is contained in:
kor 2018-10-31 12:55:51 +13:00
parent 4873154fe3
commit f5fe267ba9
2 changed files with 2 additions and 3 deletions

View File

@ -4,7 +4,6 @@ const SETTINGS =
STATSNUMTYPE: 10,
WIDEGRIDITEM: true,
USEMASONRY: true,
MASONRYCOMPLETE: true,
MASONRYPROGRESS: true,
GRIDITEMIDBASE: 'item',
SHOWUPPER: true,

View File

@ -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(); } );