 											#log "prepended: requested #{bufferSize} received #{result.length} buffer size #{buffer.length} first #{first} next #{next}"
 										finalize(rid, newItems)
 
+
+						# events and bindings
+
 						resizeAndScrollHandler = ->
-							if !$rootScope.$$phase && !isLoading
+							if !$rootScope.$$phase && !adapter.isLoading
 								adjustBuffer()
 								$scope.$apply()
 

							throw new Error "#{datasourceName} is not a valid datasource" unless isDatasource datasource

						adapterAttr = getValueChain($scope, $attr.adapter, true) if $attr.adapter

						bufferSize = Math.max(3, +$attr.bufferSize || 10)
						bufferPadding = -> viewport.outerHeight() * Math.max(0.1, +$attr.padding || 0.1) # some extra space to initate preload

							adjustBuffer rid, newItems, ->
								pending.shift()
								if pending.length == 0
									loading(false)
								else
									fetch(rid)
