     # afterAttach is called 2x when dep cop is the active pane item on reload.
     return if @subscribedToEvents
 
+    self = this
+
     @openBlogPost.on 'click', =>
       require('shell').openExternal('http://blog.atom.io/2015/05/01/removing-deprecated-apis.html')
       false

      atom.open(pathsToOpen: [pathToOpen])

    @on 'click', '.issue-url', ->
      openExternally = (urlToOpen=@dataset.issueUrl) =>
        require('shell').openExternal(urlToOpen)

      if process.platform is 'win32'
        $.ajax 'http://git.io',
          type: 'POST'
          data: url: @dataset.issueUrl
          success: (data, status, xhr) ->
            openExternally(xhr.getResponseHeader('Location'))
          error: ->
            openExternally()
      else
        openExternally()

      false

    @subscribedToEvents = true

  destroy: ->
    @subscriptions.dispose()

                  @div class: 'list-item deprecation-message', =>
                    @raw marked(deprecation.getMessage())

                  if packageName and issueUrl = self.createIssueUrl(packageName, deprecation, stack)
                    repoUrl = self.getRepoUrl(packageName)
                    issueTitle = "#{deprecation.getOriginName()} is deprecated."
                    @div class: 'btn-toolbar', =>
                      @button class: 'btn issue-url', 'data-issue-title': issueTitle, 'data-repo-url': repoUrl, 'data-issue-url': issueUrl, 'Report Issue'

                  @div class: 'stack-trace', =>
                    for {functionName, location, fileName} in stack
