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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 7714008: File Manager: fix date sorting initialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 4bcf9cdeedffd4d9397c5a08b20f9a7aa7923465..9b9fe86d41daa04b85b3a762875360003914d1d1 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -139,6 +139,8 @@ function FileManager(dialogDom, filesystem, rootEntries) {
this.summarizeSelection_();
this.updatePreview_();
+ this.dataModel_.sort('cachedMtime_');
+
this.refocus();
// Pass all URLs to the metadata reader until we have a correct filter.
@@ -635,7 +637,6 @@ FileManager.prototype = {
this.compareMtime_.bind(this));
this.dataModel_.setCompareFunction('cachedSize_',
this.compareSize_.bind(this));
- this.dataModel_.sort('cachedMtime_');
this.dataModel_.prepareSort = this.prepareSort_.bind(this);
if (this.dialogType_ == FileManager.DialogType.SELECT_OPEN_FILE ||
@@ -661,10 +662,10 @@ FileManager.prototype = {
* Compare by mtime first, then by name.
*/
FileManager.prototype.compareMtime_ = function(a, b) {
- if (a.cachedMtime_ > b.cachedMtime)
+ if (a.cachedMtime_ > b.cachedMtime_)
return 1;
- if (a.cachedMtime_ < b.cachedMtime)
+ if (a.cachedMtime_ < b.cachedMtime_)
return -1;
return this.collator_.compare(a.name, b.name);
@@ -674,10 +675,10 @@ FileManager.prototype = {
* Compare by size first, then by name.
*/
FileManager.prototype.compareSize_ = function(a, b) {
- if (a.cachedSize_ > b.cachedSize)
+ if (a.cachedSize_ > b.cachedSize_)
return 1;
- if (a.cachedSize_ < b.cachedSize)
+ if (a.cachedSize_ < b.cachedSize_)
return -1;
return this.collator_.compare(a.name, b.name);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698