   _addParagraphButton: (el) ->
     return unless @_paragraphHasContent(el)
 
-    @_paragraphButtons.push new ParagraphButton el: el
+    @_paragraphButtons.push new ParagraphButton el
 
   addParagraphButtons: ->
     return unless FactlinkJailRoot.can_haz.paragraph_icons

class IconButton

  constructor: ->
    @frame = new FactlinkJailRoot.ControlIframe()
    @frame.setContent($.parseHTML(@content.trim())[0])
    @$el = $(@frame.frameBody.firstChild)

  destroy: =>
    @frame.destroy()
    @_robustHover.destroy()
    $(window).off 'resize', @_updatePosition
    clearInterval @_interval
    @$boundingBox?.remove()

  _bindCallbacks: (callbacks) ->
    @_robustHover = new FactlinkJailRoot.RobustHover @$el, callbacks
    @$el.on 'click', -> callbacks.click?()

  # TODO: do all updates of different buttons in one pass
  _updatePositionRegularly: ->

class ParagraphButton extends IconButton
  content: '<div class="fl-icon-button"><span class="icon-comment"></span>+</div>'

  constructor: (paragraphElement) ->
    @frame = new FactlinkJailRoot.ControlIframe()
    @frame.setContent($.parseHTML(@content.trim())[0])
    $el = $(@frame.frameBody.firstChild)

    @_robustHover = new FactlinkJailRoot.RobustHover $el,
      mouseenter: => @frame.addClass 'hovered'
      mouseleave: => @frame.removeClass 'hovered'
    $el.on 'click', @_onClick

    @$paragraph = $(paragraphElement)

    @frame.fadeIn()
    @_updatePositionRegularly()
