     @loader.loadPods()
     @progressBar.start()
   didLoad: (chunk_id, pods) ->
-    @progressBar.update(chunk_id)
+    @progressBar.update(@loader.progress())
     @pods = @pods.concat(pods)
     if @delegate && @delegate.podsDidChange
       @delegate.podsDidChange()

      controller.podsChunkDidLoad(chunk_id, pods)
    xhr.send()
    @requests.push(xhr)
  podsChunkDidLoad: (chunk_id, pods) ->
    if @delegate
      if @delegate.didLoad
        @delegate.didLoad(chunk_id, pods)
      if @delegate.didLoadAll
        if (gon.pods_index[gon.pods_index.length - 1][0] == chunk_id)
          @delegate.didLoadAll()
class @PodsController
  delegate: null

class PodsLoader
  delegate: null
  requests: []
  running: 0
  finished: 0
  progress: ->
    @finished / (@finished + @running)
  cancel: ->
    for request in @requests
      request.abort()
    @requests = []
    @running = 0
    @finished = 0
  loadPods: ->
    @cancel()
    for chunk in gon.pods_index
