       view = new Views.SearchResultsView {collection: workspace}
       mainArea.show view
 
-      # Update the URL
+      # Update the URL once the Folder is fully loaded
       model.loaded().done =>
         # Update the URL
         Backbone.history.navigate "content/#{model.get 'id'}"


    # If new content is created/loaded, add it to the workspace
    initialize: ->
      @on 'add', (model) => Models.ALL_CONTENT.add model
      @on 'reset', (collection) => Models.ALL_CONTENT.add @models

      @listenTo Models.ALL_CONTENT, 'add', (model) =>
        @add model


  Models.WORKSPACE = new AtcWorkspace()

  resetDesktop = ->
    # Clear out all the content and reset `EPUB_CONTAINER` so it is always fetched
    Models.ALL_CONTENT.reset()
    Models.WORKSPACE.fetch()




  # HACK: to always get an authenticated user
  # by adding a request header
  Backbone.ajax = (config) ->
    config = _.extend config,
      headers:
        'REMOTE_USERURI': 'cnxuser:75e06194-baee-4395-8e1a-566b656f6920'
    Backbone.$.ajax.apply(Backbone.$, [config])


