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 |