From 4873154fe3a8e6d2956dae83c29e1f07cabd2a4f Mon Sep 17 00:00:00 2001 From: kor Date: Wed, 31 Oct 2018 12:50:38 +1300 Subject: [PATCH] Add setting for masonry layout reload on image load progress. --- docs/content/data.ndtl | 8 +++++++- docs/content/settings.js | 4 +++- docs/logic/view.js | 21 +++++++++++++++------ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/content/data.ndtl b/docs/content/data.ndtl index 7cb3ebb..52268cc 100644 --- a/docs/content/data.ndtl +++ b/docs/content/data.ndtl @@ -3955,4 +3955,10 @@ WITH LOVE FROM VERY SMALL PLACES TYPE : music AUTH : kodedninja TAGS : ambient, calm - LINK : https://0x22.bandcamp.com/album/with-love-from-very-small-places \ No newline at end of file + 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 \ No newline at end of file diff --git a/docs/content/settings.js b/docs/content/settings.js index 2e999f5..5bf67c7 100644 --- a/docs/content/settings.js +++ b/docs/content/settings.js @@ -4,6 +4,8 @@ const SETTINGS = STATSNUMTYPE: 10, WIDEGRIDITEM: true, USEMASONRY: true, + MASONRYCOMPLETE: true, + MASONRYPROGRESS: true, GRIDITEMIDBASE: 'item', SHOWUPPER: true, SHOWTITLE: true, @@ -16,7 +18,7 @@ const SETTINGS = SHOWNOTE: true, SHOWQOTE: true, SHOWTERM: true, - SHOWDONE: false, + SHOWDONE: true, SHOWPROG: true, SHOWIMAG: true, SHOWFILE: true, diff --git a/docs/logic/view.js b/docs/logic/view.js index 556aada..42590c0 100644 --- a/docs/logic/view.js +++ b/docs/logic/view.js @@ -50,13 +50,22 @@ function View() { this.msnry.reloadItems(); this.msnry.layout(); - } - let imgLoad = imagesLoaded( container ); - // When all images finish: redo mansonry layout - imgLoad.on( 'always', function() { parent.msnry.layout(); } ); - // As images load one by one: redo masonry layout - // imgLoad.on( 'progress', function() { parent.msnry.layout(); } ); + if (SETTINGS.MASONRYCOMPLETE || SETTINGS.MASONRYPROGRESS) + { + let imgLoad = imagesLoaded( container ); + if (SETTINGS.MASONRYCOMPLETE) + { + // When all images finish: redo mansonry layout + imgLoad.on( 'always', function() { parent.msnry.layout(); } ); + } + if (SETTINGS.MASONRYPROGRESS) + { + // As images load one by one: redo masonry layout + imgLoad.on( 'progress', function() { parent.msnry.layout(); } ); + } + } + } } this.buildEntry = function(db, key)