 									newRow = rowTop isnt itemTop
 									rowTop = itemTop
 									itemHeight = item.element.outerHeight(true) if newRow
-									if newRow and (adapter.topDataPos() + topHeight + itemHeight < topVisiblePos())
+									if newRow and (builder.topDataPos() + topHeight + itemHeight < topVisiblePos())
 											topHeight += itemHeight
 									else
 										topVisible(item) if newRow

									overage++

							if overage > 0
								adapter.bottomPadding(adapter.bottomPadding() + bottomHeight)
								removeFromBuffer(buffer.length - overage, buffer.length)
								next -= overage
								log "clipped off bottom #{overage} bottom padding #{adapter.bottomPadding()}"

						shouldLoadTop = ->
							!bof && (adapter.topDataPos() > topVisiblePos() - bufferPadding())

						clipTop = ->
							# clip the invisible items off the top

									if toBeAppended
										if index == next
											hideElementBeforeAppend clone
											builder.append clone
											buffer.push wrapper
										else
											buffer[index-first].element.after clone
											buffer.splice index-first+1, 0, wrapper
									else
										hideElementBeforeAppend clone
										builder.prepend clone
										buffer.unshift wrapper
							{appended: toBeAppended, wrapper: wrapper}

						adjustRowHeight = (appended, wrapper) ->
							if appended
								builder.bottomPadding(Math.max(0,builder.bottomPadding() - wrapper.element.outerHeight(true)))
							else
								# an element is inserted at the top
								newHeight = builder.topPadding() - wrapper.element.outerHeight(true)
								# adjust padding to prevent it from visually pushing everything down
								if newHeight >= 0
									# if possible, reduce topPadding
									builder.topPadding(newHeight)
								else
									# if not, increment scrollTop
									viewport.scrollTop(viewport.scrollTop() + wrapper.element.outerHeight(true))

						doAdjustment = (rid, finalize)->
							log "top {actual=#{builder.topDataPos()} visible from=#{topVisiblePos()} bottom {visible through=#{bottomVisiblePos()} actual=#{builder.bottomDataPos()}}"
							if shouldLoadBottom()
								enqueueFetch(rid, true)
							else
