 class Backbone.Factlink.PopoverView extends Backbone.Marionette.ItemView
-  popover:
-    selector: '.js-popover-arrow-selector'
-    popoverSelector: '.js-popover-container'
-
   constructor: (options) ->
     @ui ||= {}
     _.extend @ui,


    super(options)

    unless @popover?
      throw "PopoverView needs a popover property"

    @bindPopover()
    @on "render", @popoverOnRender, this

  bindPopover: ->
    @$el.on "click.popover", @popover.selector, =>
      @popoverToggle()
    @$el.on "click.popover_menu", @popover.popoverSelector, (e) ->
      e.stopPropagation()

  popoverOnRender: ->


  bindWindowClick: ->
    $(window).on "click.popover." + @cid, (e) =>
      if $(e.target).closest(@uiBindings.arrow)[0] isnt @$(@uiBindings.arrow)[0]
        @hidePopover()

  unbindWindowClick: ->
