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

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: . 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..6fd20ed80c7cce0956f8b8aee4c02c60857ca969 100644
--- a/chrome/browser/resources/file_manager/js/navigation_list.js
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js
@@ -446,17 +446,6 @@ NavigationList.prototype = {
__proto__: cr.ui.List.prototype,
set dataModel(dataModel) {
- if (!this.boundHandleListChanged_)
- this.boundHandleListChanged_ = this.onListContentChanged_.bind(this);
-
- if (this.dataModel_) {
- dataModel.removeEventListener('change', this.boundHandleListChanged_);
- dataModel.removeEventListener('permuted', this.boundHandleListChanged_);
- }
-
- dataModel.addEventListener('change', this.boundHandleListChanged_);
- dataModel.addEventListener('permuted', this.boundHandleListChanged_);
-
var parentSetter = cr.ui.List.prototype.__lookupSetter__('dataModel');
return parentSetter.call(this, dataModel);
},
@@ -692,11 +681,21 @@ NavigationList.prototype.onCurrentDirectoryChanged_ = function(event) {
};
/**
- * Invoked when the content in the data model is changed.
- * @param {Event} event The event.
+ * Invoked when the batch update is finished.
+ * @override
+ */
+NavigationList.prototype.endBatchUpdates = function() {
hirono 2013/09/03 08:20:30 It seems that the endBatchUpdates will not be call
yoshiki 2013/09/03 09:33:32 Good catch. Fixed.
+ // Calls the parent class method.
+ cr.ui.List.prototype.endBatchUpdates.call(this);
+
+ this.onListContentChanged_();
+};
+
+/**
+ * Invoked when the elements in the list is updated.
* @private
*/
-NavigationList.prototype.onListContentChanged_ = function(event) {
+NavigationList.prototype.onListContentChanged_ = function() {
this.selectBestMatchItem_();
};
« 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