Index: ui/file_manager/file_manager/foreground/js/dialog_action_controller.js |
diff --git a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js |
index b71cb5e84037c4e88e5f89488427e1f19bd8cbb0..369161c98e681909b5b7b66b4ce7d5feec582ae6 100644 |
--- a/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js |
+++ b/ui/file_manager/file_manager/foreground/js/dialog_action_controller.js |
@@ -116,8 +116,7 @@ |
dialogFooter.filenameInput.addEventListener( |
'input', this.updateOkButton_.bind(this)); |
fileSelectionHandler.addEventListener( |
- FileSelectionHandler.EventType.CHANGE_THROTTLED, |
- this.onFileSelectionChanged_.bind(this)); |
+ 'change', this.onFileSelectionChanged_.bind(this)); |
dialogFooter.initFileTypeFilter( |
this.fileTypes_, launchParam.includeAllFiles); |
@@ -412,13 +411,7 @@ |
this.dialogFooter_.filenameInput.value = selection.entries[0].name; |
} |
- selection.completeInit().then(function() { |
- if (this.fileSelectionHandler_.selection !== selection) |
- return; |
- this.updateOkButton_(); |
- if (!this.dialogFooter_.okButton.disable) |
- util.testSendMessage('dialog-ready'); |
- }.bind(this)); |
+ this.updateOkButton_(); |
}; |
/** |
@@ -449,19 +442,27 @@ |
return; |
} |
+ var isDriveOffline = |
+ this.volumeManager_.getDriveConnectionState().type === |
+ VolumeManagerCommon.DriveConnectionType.OFFLINE; |
+ var filesAvailable = |
+ !this.directoryModel_.isOnDrive() || |
+ !isDriveOffline || |
+ selection.allDriveFilesPresent; |
+ |
if (this.dialogType_ === DialogType.SELECT_OPEN_FILE) { |
this.dialogFooter_.okButton.disabled = |
+ !filesAvailable || |
selection.directoryCount !== 0 || |
- selection.fileCount !== 1 || |
- !this.fileSelectionHandler_.isAvailable(); |
+ selection.fileCount !== 1; |
return; |
} |
if (this.dialogType_ === DialogType.SELECT_OPEN_MULTI_FILE) { |
this.dialogFooter_.okButton.disabled = |
+ !filesAvailable || |
selection.directoryCount !== 0 || |
- selection.fileCount === 0 || |
- !this.fileSelectionHandler_.isAvailable(); |
+ selection.fileCount === 0; |
return; |
} |