     $el.on 'click', @_onClick
 
     @$paragraph = $(paragraphElement)
-
     @frame.fadeIn()
-    @_updatePositionRegularly()
-
-    FactlinkJailRoot.on 'factlink.factsLoaded factlinkAdded', @_destroyIfContainsFactlink
+    FactlinkJailRoot.on 'updateIconButtons', @_update
+    @_update()
 
   destroy: ->
-    super
+    @$boundingBox?.remove()
     @_robustHover.destroy()
     @frame.destroy()
-    FactlinkJailRoot.off 'factlink.factsLoaded factlinkAdded', @_destroyIfContainsFactlink
+    FactlinkJailRoot.off 'updateIconButtons', @_update
+
+  _update: =>
+    @_updatePosition()
+    @_destroyIfContainsFactlink()
 
   _destroyIfContainsFactlink: =>
     if @$paragraph.find('.factlink').length > 0

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

  # TODO: do all updates of different buttons in one pass
  _updatePositionRegularly: ->
    $(window).on 'resize', @_updatePosition
    @_interval = setInterval @_updatePosition, 1000
    @_updatePosition()


class FactlinkJailRoot.ShowButton extends IconButton
  content: '<div class="fl-icon-button"><span class="icon-comment"></span></div>'

  constructor: (highlightElements, factId) ->

    @$highlightElements.on 'click', @_onClick

    @frame.fadeIn()
    FactlinkJailRoot.on 'updateIconButtons', @_updatePosition
    @_updatePosition()

  destroy: ->
    @$boundingBox?.remove()
    @_robustHover.destroy()
    @$highlightElements.off 'mouseenter', @_onHover
    @$highlightElements.off 'mouseleave', @_onUnhover
    @$highlightElements.off 'click', @_onClick
    @frame.destroy()
    FactlinkJailRoot.off 'updateIconButtons', @_updatePosition

  _onHover: =>
    @frame.addClass 'hovered'
