Editor: add sections asynchronously on init
Improves perceived responsiveness. Becomes noticeable with ~3 sections. Becomes indispensable with ~10 sections.
This commit is contained in:
parent
374244fceb
commit
ed9ce87d99
6
edit.js
6
edit.js
|
@ -489,7 +489,11 @@ function initWithStyle(style) {
|
|||
Array.prototype.forEach.call(document.querySelectorAll("#sections > div"), function(div) {
|
||||
div.parentNode.removeChild(div);
|
||||
});
|
||||
style.sections.forEach(function(section) { addSection(null, section) });
|
||||
style.sections.forEach(function(section) {
|
||||
setTimeout(function() {
|
||||
addSection(null, section)
|
||||
}, 0);
|
||||
});
|
||||
setupGlobalSearch();
|
||||
setCleanGlobal(null);
|
||||
initTitle();
|
||||
|
|
Loading…
Reference in New Issue
Block a user