| 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);
|
|
|