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

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

Issue 16351002: Fix problems when renaming and entering a directory fast in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | 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/sidebar.js
diff --git a/chrome/browser/resources/file_manager/js/sidebar.js b/chrome/browser/resources/file_manager/js/sidebar.js
index 2c75c844b2d3addef23c5f99f5343db996ebcf1f..36478b485a50731cad60be38f276af197a1fb521 100644
--- a/chrome/browser/resources/file_manager/js/sidebar.js
+++ b/chrome/browser/resources/file_manager/js/sidebar.js
@@ -373,11 +373,26 @@ DirectoryItem.prototype.decorate = function(
* a complex layout. This call is not necessary, so we are ignoring it.
*
* @param {boolean} unused Unused.
+ * @override
*/
DirectoryItem.prototype.scrollIntoViewIfNeeded = function(unused) {
};
/**
+ * Removes the child node, but without selecting the parent item, to avoid
+ * unintended changing of directories. Removing is done externally, and other
+ * code will navigate to another directory.
+ *
+ * @param {!cr.ui.TreeItem} child The tree item child to remove.
+ * @override
+ */
+DirectoryItem.prototype.remove = function(child) {
+ this.lastElementChild.removeChild(child);
+ if (this.items.length == 0)
+ this.hasChildren = false;
+};
+
+/**
* Invoked when the item is being expanded.
* @param {!UIEvent} e Event.
* @private
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698