   hideLinkAction: (url) ->
     if url of feedbin.linkActions
       tooltip = feedbin.linkActions[url].tooltip
-      if url of feedbin.linkActions && !tooltip.is(':hover')
+      if url of feedbin.linkActions && !tooltip.is(':hover') && !$(feedbin.linkActions[url].popper.reference).is(':hover')
         tooltip.addClass('hide')
         tooltip.removeClass('open')
         tooltip.remove()


      $(document).on 'mouseenter mouseleave', 'body:not(.touch) .entry-final-content a', (event) ->
        link = $(@)
        if link.text().trim().length > 0 && !$(@).has('.mejs__container').length > 0 && !link.closest(".system-content").length && !link.closest(".bigfoot-footnote").length
          url = link.attr('href')
          tooltip = $('[data-behavior~=link_actions_template] [data-behavior~=link_actions]').clone()
          tooltip.data('url', url)

          unless url of feedbin.linkActions
            feedbin.linkActions[url] =
              linkActionsTimer: null
              linkCacheTimer: null
              linkMenuTimer: null
              linkMenuCleanup: null
              visible: false
              popper: null
              tooltip: tooltip

          clearTimeout(feedbin.linkActions[url].linkActionsTimer)
          clearTimeout(feedbin.linkActions[url].linkCacheTimer)
          clearTimeout(feedbin.linkActions[url].linkMenuTimer)
          clearTimeout(feedbin.linkActions[url].linkMenuCleanup)

          if event.type == "mouseleave"
            setTimeout((-> feedbin.hideLinkAction(url)), 350)

          if event.type == "mouseenter"
            feedbin.linkActions[url].linkCacheTimer = setTimeout((-> cacheLink(url)), 100)
            feedbin.linkActions[url].linkActionsTimer = setTimeout((-> showLinkActions(url, link)), 400)

    loadLinksInApp: ->
      $(document).on 'click', '[data-behavior~=entry_final_content] a', (event) ->

        feedbin.updateFeedSearchMessage()

    linkActionsHover: ->
      cacheLink = (link) ->
        unless link.is("[data-link-cached]")
          link.attr('data-link-cached', "true")
          url = link.attr('href')
          form = $("[data-behavior~=extract_cache_form]")
          $("#url", form).val(url)
          form.submit()

      showLinkActions = (url, link) ->
        if url of feedbin.linkActions
          feedbin.linkActions[url].tooltip.removeClass('hide')

      $(document).on 'click', '[data-behavior~=open_item]', (event) ->
        feedbin.hideLinkActions()
