 
 class CommitDetailsView extends HTMLElement
   createdCallback: ->
-    @el       = $(@)
-    @tabIndex = -1
+    @el        = $(@)
+    @tabIndex  = -1
+    @viewCache = {}
 
     @setFont()
     @git = new GitHistory

    @style.fontSize   = "#{fontSize}px"

  renderCommit: (e, sha) ->
    self = @
    @git.getCommit(sha)
    .then (commit) =>
      self.commit = commit
      @innerHTML = ''
      header = new CommitHeaderView
      header.setCommit(@commit)
      @appendChild(header)
      @git.getDiff(sha)
    .then (diffList) =>
      window.actionTimestamp = actionTimestamp = Date.now()

      promise = Promise.resolve()
      for diff in diffList
        _.chunkAll(diff.patches(), chunkSize).forEach (patches) =>
          promise = promise.then => new Promise (resolve) =>
            return unless actionTimestamp == window.actionTimestamp
            setImmediate =>
              patches.forEach (patch) =>
                patchView = new PatchView
                patchView.setPatch
                  patch: patch
                  commit: @commit
                commitNode.appendChild(patchView)

              resolve()

