-class Button
-  constructor: ->
-    @frame = new FactlinkJailRoot.ControlIframe()
-    @frame.setContent($.parseHTML(@content.trim())[0])
-    @$el = $(@frame.frameBody.firstChild)
-
-  _bindCallbacks: (callbacks) ->
-    @_robustHover = new FactlinkJailRoot.RobustHover @$el, callbacks
-    @$el.on 'click', -> callbacks.click?()
-
-  startHovering: => @frame.addClass 'hovered'
-  stopHovering: => @frame.removeClass 'hovered'
-
-  # TODO: do all updates of different buttons in one pass
-  _updatePositionRegularly: ->
-    $(window).on 'resize', @_updatePosition
-    @_interval = setInterval @_updatePosition, 1000
-    @_updatePosition()
-
-  _updatePosition: =>
-
-
-class FactlinkJailRoot.CreateButton extends Button
+class FactlinkJailRoot.CreateButton
   content: """
     <div class="fl-button fl-button-black fl-button-with-arrow-down">
       <div class="fl-button-content-default">

  """

  constructor: ->
    super

    @_robustHover = new FactlinkJailRoot.RobustHover @$el,
      mouseenter: => @startHovering()
      mouseleave: => @stopHovering()

    @$el.on 'mousedown', (event) -> event.preventDefault() # To prevent de-selecting text
    @$el.on 'click', @_onClick

    @_visible = false


class IconButton

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

  destroy: =>
    @frame.destroy()
