git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 0b00c09dbad2084484c6c9a0b82c18e483c1115d

scroller: append full rendered queue if any more items needed

Matt McKegg committed on 6/28/2017, 7:33:07 AM
Parent: c76133dc67bbb6ba2a9c7258d107d794fc3ce581

Files changed

lib/scroller.jschanged
lib/scroller.jsView
@@ -17,10 +17,12 @@
1717 var appendQueue = []
1818
1919 function appendLoop () {
2020 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+ }
2325 }
2426
2527 toAppendCount.set(appendQueue.length)
2628 if (queueLength() < 5) {

Built with git-ssb-web