| Index: ui/file_manager/file_manager/foreground/js/file_manager_commands.js
|
| diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
|
| index 1d684d058b15f439d9aaa42e1c71604d8038d61a..3b1bf35ec005fdb4878c5f6583f9f1e2c3cd0d62 100644
|
| --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
|
| +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
|
| @@ -107,6 +107,23 @@
|
| };
|
|
|
| /**
|
| + * Returns a single selected/passed entry or null.
|
| + * @param {!Event} event Command event.
|
| + * @param {!FileManager} fileManager FileManager to use.
|
| + * @return {FileEntry} The entry or null.
|
| + */
|
| +CommandUtil.getSingleEntry = function(event, fileManager) {
|
| + if (event.target.entry) {
|
| + return event.target.entry;
|
| + }
|
| + var selection = fileManager.getSelection();
|
| + if (selection.totalCount == 1) {
|
| + return selection.entries[0];
|
| + }
|
| + return null;
|
| +};
|
| +
|
| +/**
|
| * Obtains target entries that can be pinned from the selection.
|
| * If directories are included in the selection, it just returns an empty
|
| * array to avoid confusing because pinning directory is not supported
|
| @@ -219,7 +236,7 @@
|
| return null;
|
| if (!selection.entries[0].isDirectory)
|
| return null;
|
| - return /** @type {!DirectoryEntry} */(selection.entries[0]);
|
| + return selection.entries[0];
|
| };
|
|
|
| /**
|
|
|