     getItemsToView: (props) ->
       # Sets up our collection that we will be using.
       onlyIdsToPreview = props.query.only_preview?.split(',')
-      isSearchResults = !!props.query.search_term
-      if isSearchResults
-        folder = props.collection.models
-        files = folder
-      else
-        folder = props.currentFolder
-        files = folder.files
-
-      otherItems =  if onlyIdsToPreview # expects this to be [1,2,34,9] (ids of files to preview)
-                      files.filter (file) ->
-                        file.id in onlyIdsToPreview
-                    else
-                      files
-
-      # If preview contains data (i.e. ?preview=4)
-      if props.query.preview
-        # We go back to the folder to pull this data.
-        initialItem = if isSearchResults
-                        _.find folder, (file) =>
-                          file.id is props.query.preview
-                      else
-                        files.get(props.query.preview)
-
-
-      # If preview doesn't contain data (i.e. ?preview)
-      # we'll just use the first one in our otherItems collection.
-      else
-        # Because otherItems may (or may not be) a Backbone collection (FilesCollection) we change up our method.
-        initialItem = if otherItems instanceof Backbone.Collection
-          otherItems.first()
-        else
-          _.first(otherItems)
+      files = if !!props.query.search_term
+                props.collection.models
+              else
+                props.currentFolder.files.models
+
+      otherItems =  files.filter (file) ->
+                      return true unless onlyIdsToPreview
+                      file.id in onlyIdsToPreview
+
+      initialItem = (props.query.preview and _.findWhere(files, {id: props.query.preview})) or files[0]
 
       {initialItem, otherItems}
 

    getNavigationParams: (opts = {id: null, except: []}) ->
      obj =
        preview: (opts.id if opts.id)
        search_term: (@props.query.search_term if @props.search_term)
        only_preview: (@state.otherItemsString if @state.otherItemsString)

      _.each obj, (v, k) ->

          className: 'ef-file-preview-container-arrow-link'
        },
          div {className: 'ef-file-preview-arrow-link'},
            i {className: "icon-arrow-open-#{direction}"}



    scrollLeft: (event) ->
      width = $('.ef-file-preview-footer-list').width()
