           $("#logs .refresh, #logs .clear").show()
 
   clearMemory: (e) ->
+
     if confirm("Are you sure you want to clear memory of this Agent?")
       agentId = $(e.target).closest("[data-agent-id]").data("agent-id")
       e.preventDefault()

        .fail ->
          $("#memory .spinner").fadeOut ->
            $("#memory .clear").css(display: 'inline-block')

    $('#toggle-memory').click ->
      if $('#memorypanel').hasClass('hidden')
        $('#memorypanel').removeClass 'hidden'
      else
        $('#memorypanel').addClass 'hidden'

$ ->
  Utils.registerPage(AgentShowPage, forPathsMatching: /^agents\/\d+/)

class @AgentShowPage
  constructor: ->

    $(".agent-show #show-tabs a[href='#logs'], #logs .refresh").on "click", @fetchLogs
    $(".agent-show #logs .clear").on "click", @clearLogs
