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
|
AUTH : kodedninja
|
||||||
LINK : https://github.com/kodedninja/orkl
|
LINK : https://github.com/kodedninja/orkl
|
||||||
NOTE : reference for memex loading (spinner)
|
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
|
// BUILD
|
||||||
this.grid.innerHTML = '';
|
let dbKeys = Object.keys(db);
|
||||||
var dbKeys = Object.keys(db);
|
let i = 0;
|
||||||
var i = 0;
|
let contentHtml = '';
|
||||||
while (i < dbKeys.length)
|
while (i < dbKeys.length)
|
||||||
{
|
{
|
||||||
this.buildEntry(db, dbKeys[i]);
|
contentHtml += this.buildEntry(db, dbKeys[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
this.grid.innerHTML = contentHtml;
|
||||||
|
|
||||||
// LAYOUT
|
// LAYOUT
|
||||||
if (SETTINGS.USEMASONRY)
|
if (SETTINGS.USEMASONRY)
|
||||||
@ -74,7 +75,7 @@ function View()
|
|||||||
this.msnry.layout();
|
this.msnry.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
var imgLoad = imagesLoaded( container );
|
let imgLoad = imagesLoaded( container );
|
||||||
// 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(); } );
|
||||||
}
|
}
|
||||||
@ -324,8 +325,7 @@ function View()
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry += `</div>`;
|
entry += `</div>`;
|
||||||
|
return entry;
|
||||||
this.grid.innerHTML += entry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.doTypeIcon = function(type, count)
|
this.doTypeIcon = function(type, count)
|
||||||
|
Loading…
Reference in New Issue
Block a user