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

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..d6ec15cf22d92913e8081eea3cc03824948d143c 100644
--- a/chrome/browser/resources/file_manager/js/navigation_list.js
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js
@@ -446,19 +446,23 @@ NavigationList.prototype = {
__proto__: cr.ui.List.prototype,
set dataModel(dataModel) {
- if (!this.boundHandleListChanged_)
- this.boundHandleListChanged_ = this.onListContentChanged_.bind(this);
+ if (!this.onListContentChangedBound_)
+ this.onListContentChangedBound_ = this.onListContentChanged_.bind(this);
if (this.dataModel_) {
- dataModel.removeEventListener('change', this.boundHandleListChanged_);
- dataModel.removeEventListener('permuted', this.boundHandleListChanged_);
+ this.dataModel_.removeEventListener(
+ 'change', this.onListContentChangedBound_);
+ this.dataModel_.removeEventListener(
+ 'permuted', this.onListContentChangedBound_);
}
- dataModel.addEventListener('change', this.boundHandleListChanged_);
- dataModel.addEventListener('permuted', this.boundHandleListChanged_);
-
var parentSetter = cr.ui.List.prototype.__lookupSetter__('dataModel');
- return parentSetter.call(this, 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.onListContentChangedBound_);
+ dataModel.addEventListener('permuted', this.onListContentChangedBound_);
},
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