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

Unified Diff: chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js

Issue 131103020: Fix ejecting if the element is not selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | 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/foreground/js/file_manager_commands.js
diff --git a/chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js b/chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js
index f1b9a62b9629c1499ef0a1d4260d38e035f41152..eaa37f431e6b49f18244b099ece005e90a02e35d 100644
--- a/chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js
+++ b/chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js
@@ -377,10 +377,12 @@ CommandHandler.COMMANDS_['unmount'] = {
* @param {Event} event Command event.
*/
canExecute: function(event, fileManager) {
- var root = CommandUtil.getCommandEntry(this.fileManager_.navigationList);
- var location =
- root && this.fileManager_.volumeManager.getLocationInfo(root);
- var rootType = location && location.isRootEntry && location.rootType;
+ var root = CommandUtil.getCommandEntry(event.target);
+ if (!root)
+ return;
+ var locationInfo = this.fileManager_.volumeManager.getLocationInfo(root);
+ var rootType =
+ locationInfo && locationInfo.isRootEntry && locationInfo.rootType;
event.canExecute = (rootType == RootType.ARCHIVE ||
rootType == RootType.REMOVABLE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698