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

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

Issue 789133002: 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
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/app_state_controller.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
@@ -101,14 +101,6 @@
* @const
*/
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.
@@ -201,12 +193,6 @@
// 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 @@
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;
@@ -235,34 +215,6 @@
break;
}
this.endBatchUpdates();
-};
-
-/**
- * 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_;
- }
};
/**
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/app_state_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698