Commit 0b00c09dbad2084484c6c9a0b82c18e483c1115d
scroller: append full rendered queue if any more items needed
Matt McKegg committed on 6/28/2017, 7:33:07 AMParent: c76133dc67bbb6ba2a9c7258d107d794fc3ce581
Files changed
lib/scroller.js | changed |
lib/scroller.js | ||
---|---|---|
@@ -17,10 +17,12 @@ | ||
17 | 17 | var appendQueue = [] |
18 | 18 | |
19 | 19 | function appendLoop () { |
20 | 20 | var distanceFromBottom = scroller.scrollHeight - (scroller.scrollTop + scroller.clientHeight) |
21 | - while (appendQueue.length && distanceFromBottom < scroller.clientHeight) { | |
22 | - content.appendChild(appendQueue.shift()) | |
21 | + if (distanceFromBottom < scroller.clientHeight) { | |
22 | + while (appendQueue.length) { | |
23 | + content.appendChild(appendQueue.shift()) | |
24 | + } | |
23 | 25 | } |
24 | 26 | |
25 | 27 | toAppendCount.set(appendQueue.length) |
26 | 28 | if (queueLength() < 5) { |
Built with git-ssb-web