mirror of
https://github.com/TangentFoxy/memex.git
synced 2024-11-22 04:54:23 +00:00
Improve load time with a single write to innerHTML instead of one for every entry.
This commit is contained in:
parent
83f54dc2db
commit
5128929933
@ -4067,4 +4067,11 @@ ORKL
|
||||
AUTH : kodedninja
|
||||
LINK : https://github.com/kodedninja/orkl
|
||||
NOTE : reference for memex loading (spinner)
|
||||
TAGS : p2p, dat, blog
|
||||
TAGS : p2p, dat, blog
|
||||
|
||||
WITH LOVE FROM VERY SMALL PLACES
|
||||
DATE : 12018-10-30
|
||||
TYPE : music
|
||||
AUTH : kodedninja
|
||||
TAGS : ambient, calm
|
||||
LINK : https://0x22.bandcamp.com/album/with-love-from-very-small-places
|
@ -58,14 +58,15 @@ function View()
|
||||
}
|
||||
|
||||
// BUILD
|
||||
this.grid.innerHTML = '';
|
||||
var dbKeys = Object.keys(db);
|
||||
var i = 0;
|
||||
let dbKeys = Object.keys(db);
|
||||
let i = 0;
|
||||
let contentHtml = '';
|
||||
while (i < dbKeys.length)
|
||||
{
|
||||
this.buildEntry(db, dbKeys[i]);
|
||||
contentHtml += this.buildEntry(db, dbKeys[i]);
|
||||
i++;
|
||||
}
|
||||
this.grid.innerHTML = contentHtml;
|
||||
|
||||
// LAYOUT
|
||||
if (SETTINGS.USEMASONRY)
|
||||
@ -74,7 +75,7 @@ function View()
|
||||
this.msnry.layout();
|
||||
}
|
||||
|
||||
var imgLoad = imagesLoaded( container );
|
||||
let imgLoad = imagesLoaded( container );
|
||||
// When all images finish: redo mansonry layout
|
||||
imgLoad.on( 'always', function() { parent.msnry.layout(); } );
|
||||
}
|
||||
@ -324,8 +325,7 @@ function View()
|
||||
}
|
||||
|
||||
entry += `</div>`;
|
||||
|
||||
this.grid.innerHTML += entry;
|
||||
return entry;
|
||||
}
|
||||
|
||||
this.doTypeIcon = function(type, count)
|
||||
|
Loading…
Reference in New Issue
Block a user