Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/list_container.js

Issue 788113003: Revert of Make the sort order in thumbnail view always alphabetical. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/foreground/js/ui/list_container.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/list_container.js b/ui/file_manager/file_manager/foreground/js/ui/list_container.js
index d9d3b798a5c4acac8b088779fdf458a105de360a..96bdbed10b3a5eef86141b6d2dda8bc5f032e63f 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/list_container.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/list_container.js
@@ -102,14 +102,6 @@ function ListContainer(element, table, grid) {
*/
this.textSearchState = new TextSearchState();
- /**
- * Saved sort status of DETAIL view. This is used to restore sort order when
- * the view is changed to DETAIL from THUMBNAIL, in which the sort order is
- * always alphabetical.
- * @type {!Object}
- */
- this.savedSortStatus_ = {};
-
// Overriding the default role 'list' to 'listbox' for better accessibility
// on ChromeOS.
this.table.list.setAttribute('role', 'listbox');
@@ -201,12 +193,6 @@ ListContainer.prototype.setCurrentListType = function(listType) {
// view that is not in use.
switch (listType) {
case ListContainer.ListType.DETAIL:
- // Restore the last sort status of the detail view
- if (this.savedSortStatus_) {
- this.dataModel.sort(this.savedSortStatus_.field,
- this.savedSortStatus_.direction);
- }
-
this.table.dataModel = this.dataModel;
this.table.selectionModel = this.selectionModel;
this.table.hidden = false;
@@ -216,12 +202,6 @@ ListContainer.prototype.setCurrentListType = function(listType) {
break;
case ListContainer.ListType.THUMBNAIL:
- // Save the last sort status of the detail view, and use alphabetical
- // order for the thumbnail view.
- if (this.dataModel.sortStatus.field)
- this.savedSortStatus_ = this.dataModel.sortStatus;
- this.dataModel.sort('name', 'asc');
-
this.grid.dataModel = this.dataModel;
this.grid.selectionModel = this.selectionModel;
this.grid.hidden = false;
@@ -238,34 +218,6 @@ ListContainer.prototype.setCurrentListType = function(listType) {
};
/**
- * Sets sorting order of this list container. Note that, whether the sort order
- * of list container is applied to the list depends on the list type. If the
- * list type is THUMBNAIL, the list will always be sorted in alphabetical order.
- * The given sort order will be applied after the list type becomes DETAIL.
- * @param {string} field
- * @param {string} direction
- */
-ListContainer.prototype.sort = function(field, direction) {
- if (this.currentListType === ListContainer.ListType.DETAIL) {
- this.dataModel.sort(field, direction);
- } else {
- this.savedSortStatus_ = {field: field, direction: direction};
- }
-};
-
-/**
- * Returns sort status, which is used to sort the file list in DETAIL view.
- * @return {!Object}
- */
-ListContainer.prototype.getSortStatus = function() {
- if (this.currentListType === ListContainer.ListType.DETAIL) {
- return this.dataModel.sortStatus;
- } else {
- return this.savedSortStatus_;
- }
-};
-
-/**
* Clears hover highlighting in the list container until next mouse move.
*/
ListContainer.prototype.clearHover = function() {

Powered by Google App Engine
This is Rietveld 408576698