         if $(this).hasClass("selected")
           if $(this).hasClass("popover-visible")
             toggle_popover(false, $(this))
-            #$(this).popover('hide')
-            #$(this).removeClass('popover-visible')
             isVisible = false
           else
             toggle_popover(true, $(this))
-            #$(this).popover('show')
-            #$(this).addClass('popover-visible')
             isVisible = true
         else
           toggle_popover(false, $(this))
-          #$(this).popover('hide')
-          #$(this).removeClass('popover-visible')
       $(this).removeClass("selected")
       clickedAway = false
     else
-      #$(this).popover('show')
-      #$(this).addClass('popover-visible')
       toggle_popover(true, $(this))
       clickedAway = false
       isVisible = true

  )

  toggle_popover = (show, elem) ->
    #elem.each ->
    if show
      elem.popover('show')
      elem.addClass('popover-visible')

  $(document).click((e)->
    if(isVisible & clickedAway)
      toggle_popover(false, $('.comment-user-name'))
      isVisible = false
      clickedAway = false
    else
