       return el if window.getComputedStyle(el).display == 'block'
     console.error 'FactlinkJailRoot: No text container found for ', el
 
-  _updatePosition: ->
+  _updatePosition: =>
     top = @$nearEl.offset().top + @$nearEl.outerHeight()/2 - @frame.$el.outerHeight()/2
 
     textContainer = @_textContainer(@$nearEl[0])

    @_showAtCoordinates top, left


class ParagraphButton
  constructor: (@el) ->
    @$el = $(@el)

    # TODO: actually show icon

    if FactlinkJailRoot.can_haz.debug_bounding_boxes
      contentBox = FactlinkJailRoot.contentBox(el)

      @$boundingBox = FactlinkJailRoot.drawBoundingBox contentBox, 'green'

  remove: ->
    @$boundingBox?.remove()


class FactlinkJailRoot.ParagraphButtons

    current_user_opinion = $(event.target).data('opinion')
    FactlinkJailRoot.createFactFromSelection(current_user_opinion)

  placeNearSelection: (mouseX=null) ->
    return if @_visible

