           @$owner.on "mouseleave.#{@type}.#{@cid}", (e) => @hide(e)
 
     show: (e) ->
-      e.stopPropagation()
+      @stopPropagation(e)
       @reposition()
       @$el.children(".#{@type}").show().addClass('in')
 
     hide: (e) ->
-      e.stopPropagation()
+      @stopPropagation(e)
       @$el.children(".#{@type}").hide().removeClass('in')
 
     toggle: (e) ->
-      e.stopPropagation()
+      @stopPropagation(e)
       @reposition()
       @$el.children(".#{@type}").toggle().toggleClass('in')
 

  require('less!helpers/backbone/views/attached/tooltip/tooltip')

  # Close tooltips and popovers when clicking outside of them
  $(document).click () ->
    $('.popover, .tooltip').hide().removeClass('in')

  return class Tooltip extends BaseView

      @$owner = $(options.owner)

    stopPropagation: (e) ->
      e.stopPropagation() if e.target.localName isnt 'a'

    onShow: () ->
      # Don't close due to clicks on this element
