 
 
   componentDidMount: =>
+    @tooltipHideEvent = @tooltipElement().qtip('option', 'hide.event')
     $(window).on 'throttled-resize.#{@uuid}', @resize
     $(document).on "turbolinks:before-cache.#{@uuid}", () =>
       @removePortal()


  toggle: =>
    @setState active: !@state.active


  addPortal: =>

    if @state.active
      @resize()
      @addPortal()
      @tooltipElement().qtip 'option', 'hide.event', false

      $(document).on "click.#{@uuid} keydown.#{@uuid}", @hide
      @props.onShow?()

    else
      @removePortal()
      @tooltipElement().qtip 'option', 'hide.event', @tooltipHideEvent

      $(document).off "click.#{@uuid} keydown.#{@uuid}", @hide
      @props.onHide?()

