Add setting for masonry layout reload on image load progress.

This commit is contained in:
kor 2018-10-31 12:50:38 +13:00
parent ae855de9b2
commit 4873154fe3
3 changed files with 25 additions and 8 deletions

View File

@ -3956,3 +3956,9 @@ WITH LOVE FROM VERY SMALL PLACES
AUTH : kodedninja AUTH : kodedninja
TAGS : ambient, calm TAGS : ambient, calm
LINK : https://0x22.bandcamp.com/album/with-love-from-very-small-places LINK : https://0x22.bandcamp.com/album/with-love-from-very-small-places
LIGHTING FIRES POETICS AND SENSATION
PERS : Phil James
AUTH : Phil James
LINK : https://medium.com/@shinestrength/lighting-fires-poetics-and-sensation-991d083e15e9
FILE : 12018-10-31_lightingFires.pdf

View File

@ -4,6 +4,8 @@ const SETTINGS =
STATSNUMTYPE: 10, STATSNUMTYPE: 10,
WIDEGRIDITEM: true, WIDEGRIDITEM: true,
USEMASONRY: true, USEMASONRY: true,
MASONRYCOMPLETE: true,
MASONRYPROGRESS: true,
GRIDITEMIDBASE: 'item', GRIDITEMIDBASE: 'item',
SHOWUPPER: true, SHOWUPPER: true,
SHOWTITLE: true, SHOWTITLE: true,
@ -16,7 +18,7 @@ const SETTINGS =
SHOWNOTE: true, SHOWNOTE: true,
SHOWQOTE: true, SHOWQOTE: true,
SHOWTERM: true, SHOWTERM: true,
SHOWDONE: false, SHOWDONE: true,
SHOWPROG: true, SHOWPROG: true,
SHOWIMAG: true, SHOWIMAG: true,
SHOWFILE: true, SHOWFILE: true,

View File

@ -50,13 +50,22 @@ function View()
{ {
this.msnry.reloadItems(); this.msnry.reloadItems();
this.msnry.layout(); this.msnry.layout();
}
if (SETTINGS.MASONRYCOMPLETE || SETTINGS.MASONRYPROGRESS)
{
let imgLoad = imagesLoaded( container ); let imgLoad = imagesLoaded( container );
if (SETTINGS.MASONRYCOMPLETE)
{
// When all images finish: redo mansonry layout // When all images finish: redo mansonry layout
imgLoad.on( 'always', function() { parent.msnry.layout(); } ); imgLoad.on( 'always', function() { parent.msnry.layout(); } );
}
if (SETTINGS.MASONRYPROGRESS)
{
// As images load one by one: redo masonry layout // As images load one by one: redo masonry layout
// imgLoad.on( 'progress', function() { parent.msnry.layout(); } ); imgLoad.on( 'progress', function() { parent.msnry.layout(); } );
}
}
}
} }
this.buildEntry = function(db, key) this.buildEntry = function(db, key)