         @_$highlight.removeClass 'hovered'
         @_hideHover()
 
+    @_$highlight.data 'highlight', @
+
     @_$highlightsLayer.append @_$highlight
+
+    @_sortHighlights()
 
   # React to changes in the underlying annotation
   annotationUpdated: =>

      width: rect.width
      height: rect.height

    @_precomputeHover segments

    @_$highlight = $('<div/>').addClass('highlights-layer-highlight').append(

    @_$highlightsLayer = @_$textLayer.prev('.highlights-layer')
    @_highlightsCanvas = @_$highlightsLayer.prev('.highlights-canvas').get(0)

    @_area = null
    @_hover = null
    @_$highlight = null

    @_createHighlight()

  _computeArea: (segments) =>
    @_area = 0

    for segment in segments
      @_area += segment.width * segment.height

    return # Don't return the result of the for loop

  _precomputeHover: (segments) =>
    # For now compute simply a bounding box
