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

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

Issue 10820046: Fix the event after which the callback is called from search in DirectoryModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/directory_model.js
diff --git a/chrome/browser/resources/file_manager/js/directory_model.js b/chrome/browser/resources/file_manager/js/directory_model.js
index e0e0dc423a7c5a17efe5114c5b8ad2f7c4836176..56aca9690a7e8cd04407031f3df5c1835f402de5 100644
--- a/chrome/browser/resources/file_manager/js/directory_model.js
+++ b/chrome/browser/resources/file_manager/js/directory_model.js
@@ -1132,8 +1132,8 @@ DirectoryModel.isSystemDirectory = function(path) {
* TODO(olege): Change callbacks to events.
*/
DirectoryModel.prototype.search = function(query,
- onSearchRescan,
- onClearSearch) {
+ onSearchRescan,
+ onClearSearch) {
query = query.trimLeft();
var newDirContents;
@@ -1149,13 +1149,13 @@ DirectoryModel.prototype.search = function(query,
}
// If we already have event listener for an old search, we have to remove it.
- if (this.onSearchRescan_)
- this.removeEventListener('rescan-completed', this.onSearchRescan_);
+ if (this.onSearchCompleted_)
+ this.removeEventListener('scan-completed', this.onSearchCompleted_);
- this.onSearchRescan_ = onSearchRescan;
+ this.onSearchCompleted_ = onSearchRescan;
this.onClearSearch_ = onClearSearch;
- this.addEventListener('rescan-completed', this.onSearchRescan_);
+ this.addEventListener('scan-completed', this.onSearchCompleted_);
// If we are offline, let's fallback to file name search inside dir.
if (this.getCurrentRootType() === RootType.GDATA && !this.isOffline()) {
@@ -1178,9 +1178,9 @@ DirectoryModel.prototype.clearSearch_ = function() {
if (!this.isSearching())
return;
- if (this.onSearchRescan_) {
- this.removeEventListener('rescan-completed', this.onSearchRescan_);
- this.onSearchRescan_ = null;
+ if (this.onSearchCompleted_) {
+ this.removeEventListener('scan-completed', this.onSearchCompleted_);
+ this.onSearchCompleted_ = null;
}
if (this.onClearSearch_) {
« 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