             @sorting = false
             ), SORT_TIMEOUT
 
+      # When a sort happens, instead of re-rendering all the children,
+      # just reorder the DOM.
+      #
+      # When a sort event is fired it is guaranteed no other models were
+      # added or removed.
       @listenTo @collection, 'sort', () => @reorder()
 
 

  'hbs!templates/workspace/content/search-results'
], ($, _, Backbone, Marionette, SearchResultsItemView, searchView, searchResultsTemplate) ->

  SORT_TIMEOUT = 250 # milliseconds

  SORT_COMPARATOR = (modelA, modelB) ->
    compareAttribute = (name, desc=false) ->
      valueA = modelA.get(name)


      @listenTo(searchView, 'search', @filter)

      # Attach the comparator to `allContent`.
      # This guarantees new models are added in sorted order
      # It does **not** guarantee they will remain in sorted order as they change.
      #
      # This is done by listening on `change` events in `allContent` below
      @collection.comparator = SORT_COMPARATOR
      @collection.sort()

      # Start a delayed sort on change:
      #
      # - In a large workspace sort takes a while and the page becomes unresponsive.
      # - Many change events are fired when a single title changes
      @listenTo @collection, 'change', () =>
        if not @sorting
          @sorting = setTimeout ( () =>
