Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/file_transfer_controller.js |
| diff --git a/chrome/browser/resources/file_manager/js/file_transfer_controller.js b/chrome/browser/resources/file_manager/js/file_transfer_controller.js |
| index e81219931c4697431d83422b01574a33d8aa0fed..3346a209a727275ddedd7984a3e86001d42b8458 100644 |
| --- a/chrome/browser/resources/file_manager/js/file_transfer_controller.js |
| +++ b/chrome/browser/resources/file_manager/js/file_transfer_controller.js |
| @@ -25,7 +25,7 @@ function FileTransferController(fileList, |
| this.dragNodes_ = []; |
| /** |
| - * File objects for seletced files. |
| + * File objects for selected files. |
| * @type {Array.<File>} |
| */ |
| this.files_ = []; |
| @@ -78,7 +78,7 @@ FileTransferController.prototype = { |
| * |dataTransfer.effectAllowed| property ('move', 'copy', 'copyMove'). |
| */ |
| cutOrCopy: function(dataTransfer, effectAllowed) { |
| - var directories = []; |
| + var directories = []; |
| var files = []; |
| var entries = this.selectedEntries_; |
| for (var i = 0; i < entries.length; i++) { |
| @@ -105,6 +105,7 @@ FileTransferController.prototype = { |
| * Queue up a file copy operation based on the current system clipboard. |
| * @param {DataTransfer} dataTransfer System data transfer object. |
| * @param {DirectoryEntry=} opt_destination Paste destination. |
| + * @return {string} "move"|"copy" |
| */ |
| paste: function(dataTransfer, opt_destination) { |
| var destination = opt_destination || this.currentDirectory; |
| @@ -254,7 +255,7 @@ FileTransferController.prototype = { |
| }, |
| canCopyOrDrag_: function() { |
| - return this.selectedEntries_.length > 0; |
| + return this.selectionAvailable_ && this.selectedEntries_.length > 0; |
| }, |
| onCut_: function(event) { |
| @@ -381,6 +382,10 @@ FileTransferController.prototype = { |
| return this.directoryModel_.readonly; |
| }, |
| + set selectionAvailable(available) { |
| + this.selectionAvailable_ = available; |
|
dgozman
2012/04/18 16:07:37
I don't like this 'set from outside to work proper
Vladislav Kaznacheev
2012/04/18 16:36:24
Yeah, I hate it myself. But asking the file manage
|
| + }, |
| + |
| get isOnGData() { |
| return this.directoryModel_.rootType == DirectoryModel.RootType.GDATA; |
| }, |