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

Unified Diff: ui/file_manager/file_manager/foreground/js/directory_contents.js

Issue 964393002: Dispatch change events when file changes have happened on Drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add null check. Created 5 years, 10 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
Index: ui/file_manager/file_manager/foreground/js/directory_contents.js
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js
index 9fbab1860bada90f317eaf9a95dd6c1ff0aaac94..f38b6ff548c69c00fba024a6fa47c4f8ff6d4176 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_contents.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -789,6 +789,7 @@ DirectoryContents.prototype.update = function(updatedEntries, removedUrls) {
}
var updatedList = [];
+ var updatedIndexes = [];
for (var i = 0; i < this.fileList_.length; i++) {
var url = this.fileList_.item(i).toURL();
@@ -800,10 +801,14 @@ DirectoryContents.prototype.update = function(updatedEntries, removedUrls) {
if (url in updatedMap) {
updatedList.push(updatedMap[url]);
+ updatedIndexes.push(i);
delete updatedMap[url];
}
}
+ if (updatedIndexes.length > 0)
+ this.fileList_.updateIndexes(updatedIndexes);
+
var addedList = [];
for (var url in updatedMap) {
addedList.push(updatedMap[url]);

Powered by Google App Engine
This is Rietveld 408576698