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

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

Issue 23618028: [Files.app] Refile a timing of doing selectBestMatchItem(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 7 years, 3 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/navigation_list.js
diff --git a/chrome/browser/resources/file_manager/js/navigation_list.js b/chrome/browser/resources/file_manager/js/navigation_list.js
index 8fa40e9911ee69113b31bc83c125050027eb63c7..79b346facf87707581f4f866989ce1029cb88bd1 100644
--- a/chrome/browser/resources/file_manager/js/navigation_list.js
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js
@@ -450,15 +450,19 @@ NavigationList.prototype = {
this.boundHandleListChanged_ = this.onListContentChanged_.bind(this);
if (this.dataModel_) {
- dataModel.removeEventListener('change', this.boundHandleListChanged_);
- dataModel.removeEventListener('permuted', this.boundHandleListChanged_);
+ this.dataModel_.removeEventListener(
+ 'change', this.boundHandleListChanged_);
hirono 2013/09/04 13:39:25 nit: The name pattern of xxxBound is more likely t
yoshiki 2013/09/04 14:26:55 Done.
+ this.dataModel_.removeEventListener(
+ 'permuted', this.boundHandleListChanged_);
}
+ var parentSetter = cr.ui.List.prototype.__lookupSetter__('dataModel');
+ parentSetter.call(this, dataModel);
+
+ // This must be placed after the parent method is called, in order to make
+ // it sure that the list was changed.
dataModel.addEventListener('change', this.boundHandleListChanged_);
dataModel.addEventListener('permuted', this.boundHandleListChanged_);
-
- var parentSetter = cr.ui.List.prototype.__lookupSetter__('dataModel');
- return parentSetter.call(this, dataModel);
},
get dataModel() {
« 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