From 77ffd3004d8191f6ced424efbaf577b1024659b5 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 27 Apr 2017 22:12:32 +0300 Subject: [PATCH] fixup 3dc93436: immediately render a chunk if ScrollY>0 --- manage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manage.js b/manage.js index cc298d10..20d97a03 100644 --- a/manage.js +++ b/manage.js @@ -104,9 +104,10 @@ function showStyles(styles = []) { .map(style => ({name: style.name.toLocaleLowerCase(), style})) .sort((a, b) => (a.name < b.name ? -1 : a.name == b.name ? 0 : 1)); let index = 0; - const shouldRenderAll = (history.state || {}).scrollY > window.innerHeight; + const scrollY = (history.state || {}).scrollY; + const shouldRenderAll = scrollY > window.innerHeight; const renderBin = document.createDocumentFragment(); - if (shouldRenderAll) { + if (scrollY) { renderStyles(); } else { requestAnimationFrame(renderStyles);