Commit dd3f9a9a authored by Sasha Morrissey's avatar Sasha Morrissey Committed by Commit Bot

Fix bug where selecting a folder in Files App TD doesn't update LHS

Fix bug where selecting a folder in a Team Drive in the Files App
doesn't update the currently selected folder in the left-hand directory
tree.

ensure it is reflected in the LHS.

Test: Select a folder in the RHS in the Files App in a team drive and
Bug: 840207
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ieeb9be680a043498bfbbb8f12eb38b8015c4d6bb
Reviewed-on: https://chromium-review.googlesource.com/1045957Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Commit-Queue: Sasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556694}
parent 8c569e5d
......@@ -61,6 +61,15 @@ DirectoryItemTreeBaseMethods.searchAndSelectByEntry = function(entry) {
var item = this.items[i];
if (!item.entry)
continue;
// Team drives are descendants of the Drive root volume item "Google Drive".
// When we looking for an item in team drives, recursively search inside the
// "Google Drive" root item.
if (util.isTeamDriveEntry(entry) && item instanceof DriveVolumeItem) {
item.selectByEntry(entry);
return true;
}
if (util.isDescendantEntry(item.entry, entry) ||
util.isSameEntry(item.entry, entry)) {
item.selectByEntry(entry);
......@@ -880,7 +889,7 @@ DriveVolumeItem.prototype.updateItemByEntry = function(changedDirectoryEntry) {
* @override
*/
DriveVolumeItem.prototype.selectByEntry = function(entry) {
// Find the item to be selected amang children.
// Find the item to be selected among children.
this.searchAndSelectByEntry(entry);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment