 
   stopLoading: ->
     @_loading = false
-    @stopEmphasis()
+    @highlighter.dehighlight()
+    @button.hide()
 
   destroy: ->
     for el in @elements


class Factlink.Fact
  constructor: (@id, @elements) ->
    @attention_span = new Factlink.AttentionSpan
      lost_attention: => @stopEmphasis()
      gained_attention: => @startEmphasis()

    @highlighter = new Highlighter $(@elements)



  highlight_temporary: (duration) ->
    @highlighter.highlight()
    setTimeout =>
      @highlighter.dehighlight() unless @shouldHaveEmphasis()
    , duration

  onBlur: ->
    @highlight_attention.neglect()
    @button_attention.neglect()
  onFocus: (e) =>
    if e?
      @show_button.setCoordinates($(e.target).offset().top, e.pageX)
    @highlight_attention.attend()
    @button_attention.attend()

  shouldHaveEmphasis: => @highlight_attention.has_attention() || @_loading

  openFactlinkModal: =>
    @startLoading()
