Commit 765fd08a authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Fix handling of clicks on the Google Drive expand icon.

https://crrev.com/609910 made activating "Google Drive" via the enter
key expand it and select "My Drive". However, it also made clicking on
the expand icon have that effect. Correct this by plumbing through the
event target so the same conditions apply for click events as before.

Bug: 825779
Change-Id: I38661323ce1aa5fc9eeec9968aae09259c9dc84d
Reviewed-on: https://chromium-review.googlesource.com/c/1347970Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610516}
parent 989e4d78
......@@ -1087,7 +1087,7 @@ DriveVolumeItem.prototype = {
DriveVolumeItem.prototype.handleClick = function(e) {
VolumeItem.prototype.handleClick.call(this, e);
this.selectDisplayRoot_();
this.selectDisplayRoot_(e.target);
DirectoryItemTreeBaseMethods.recordUMASelectedEntry.call(
this, e, VolumeManagerCommon.RootType.DRIVE_FAKE_ROOT, true);
......@@ -1234,14 +1234,15 @@ DriveVolumeItem.prototype.createComputersGrandRoot_ = function() {
*/
DriveVolumeItem.prototype.activate = function() {
VolumeItem.prototype.activate.call(this);
this.selectDisplayRoot_();
this.selectDisplayRoot_(this);
};
/**
* Select Drive's display root.
* @param {EventTarget} target The event target.
*/
DriveVolumeItem.prototype.selectDisplayRoot_ = function() {
if (!this.classList.contains('expand-icon')) {
DriveVolumeItem.prototype.selectDisplayRoot_ = function(target) {
if (!target.classList.contains('expand-icon')) {
// If the Drive volume is clicked, select one of the children instead of
// this item itself.
this.volumeInfo_.resolveDisplayRoot((displayRoot) => {
......
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