Commit b8452b57 authored by mtomasz@chromium.org's avatar mtomasz@chromium.org

Fix ejecting if the element is not selected.

This patch fixes a recent regression, which was incorrectly taking the selection instead of the element the eject button is on.

TEST=Tested manually with archives.
BUG=337577

Review URL: https://codereview.chromium.org/131103020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247696 0039d316-1c4b-4281-b951-d872f2087c98
parent 895d7365
...@@ -377,10 +377,12 @@ CommandHandler.COMMANDS_['unmount'] = { ...@@ -377,10 +377,12 @@ CommandHandler.COMMANDS_['unmount'] = {
* @param {Event} event Command event. * @param {Event} event Command event.
*/ */
canExecute: function(event, fileManager) { canExecute: function(event, fileManager) {
var root = CommandUtil.getCommandEntry(this.fileManager_.navigationList); var root = CommandUtil.getCommandEntry(event.target);
var location = if (!root)
root && this.fileManager_.volumeManager.getLocationInfo(root); return;
var rootType = location && location.isRootEntry && location.rootType; var locationInfo = this.fileManager_.volumeManager.getLocationInfo(root);
var rootType =
locationInfo && locationInfo.isRootEntry && locationInfo.rootType;
event.canExecute = (rootType == RootType.ARCHIVE || event.canExecute = (rootType == RootType.ARCHIVE ||
rootType == RootType.REMOVABLE); rootType == RootType.REMOVABLE);
......
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