diff options
author | rginda@chromium.org <rginda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 23:43:31 +0000 |
---|---|---|
committer | rginda@chromium.org <rginda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 23:43:31 +0000 |
commit | 83f6d3b165b7cb85dcfbea4e3dca4cc656eedda2 (patch) | |
tree | bd71cef52fc6e038917f0af1b0c6e26a0bb6f19f | |
parent | 1f0b98f4c9a3364308602d80246c5c3d1300bf0d (diff) | |
download | chromium_src-83f6d3b165b7cb85dcfbea4e3dca4cc656eedda2.zip chromium_src-83f6d3b165b7cb85dcfbea4e3dca4cc656eedda2.tar.gz chromium_src-83f6d3b165b7cb85dcfbea4e3dca4cc656eedda2.tar.bz2 |
Merge 98144 - File Manager: fix date sorting initialization
BUG=chromium-os:19082
TEST=manual testing
Review URL: http://codereview.chromium.org/7714008
TBR=rginda@chromium.org
Review URL: http://codereview.chromium.org/7743005
git-svn-id: svn://svn.chromium.org/chrome/branches/835/src@98145 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/file_manager/js/file_manager.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js index a46b83d..6d167a3 100644 --- a/chrome/browser/resources/file_manager/js/file_manager.js +++ b/chrome/browser/resources/file_manager/js/file_manager.js @@ -146,6 +146,8 @@ function FileManager(dialogDom, rootEntries, params) { this.summarizeSelection_(); this.updatePreview_(); + this.dataModel_.sort('cachedMtime_'); + this.refocus(); // Pass all URLs to the metadata reader until we have a correct filter. @@ -637,7 +639,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 || @@ -663,10 +664,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); @@ -676,10 +677,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); |