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

Unified Diff: chrome/browser/resources/file_manager/js/action_choice.js

Issue 12913023: Removed the OK button from the action choice dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 7 years, 9 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 | « chrome/browser/resources/file_manager/css/action_choice.css ('k') | 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/js/action_choice.js
diff --git a/chrome/browser/resources/file_manager/js/action_choice.js b/chrome/browser/resources/file_manager/js/action_choice.js
index d2116a6f99de4129957e78cfe739a445ec8cfd04..58163879981ad25dd61ca9a656dc465e30cfdac2 100644
--- a/chrome/browser/resources/file_manager/js/action_choice.js
+++ b/chrome/browser/resources/file_manager/js/action_choice.js
@@ -167,18 +167,15 @@ ActionChoice.prototype.initDom_ = function() {
this.list_.selectionModel = new cr.ui.ListSingleSelectionModel();
this.list_.dataModel = new cr.ui.ArrayDataModel([]);
this.list_.autoExpands = true;
- this.list_.activateItemAtIndex = function(index) {
+
+ var acceptActionBound = function() {
this.acceptAction_();
}.bind(this);
+ this.list_.activateItemAtIndex = acceptActionBound;
+ this.list_.addEventListener('click', acceptActionBound);
this.previews_ = this.document_.querySelector('.previews');
this.counter_ = this.document_.querySelector('.counter');
-
- this.document_.querySelector('button.ok').addEventListener('click',
- function(event) {
- this.acceptAction_();
- }.bind(this));
-
this.document_.addEventListener('keydown', this.onKeyDown_.bind(this));
metrics.startInterval('PhotoImport.Load');
@@ -277,7 +274,7 @@ ActionChoice.prototype.loadSource_ = function(source, callback) {
var videos = results.filter(FileType.isVideo);
if (videos.length == 1) {
this.singleVideo_ = videos[0];
- this.enabledOptions_.push(ActionChoice.Action.PLAY_VIDEO);
+ this.enabledOptions_.push(ActionChoice.Action.WATCH_SINGLE_VIDEO);
this.watchSingleVideoItem_.title = loadTimeData.getStringF(
'ACTION_CHOICE_WATCH_SINGLE_VIDEO', videos[0].name);
this.watchSingleVideoItem_.hidden = false;
@@ -401,10 +398,13 @@ ActionChoice.prototype.close_ = function() {
*/
ActionChoice.prototype.onKeyDown_ = function(e) {
switch (util.getKeyModifiers(e) + e.keyCode) {
+ case '13':
+ this.acceptAction_();
+ break;
case '27':
this.recordAction_('close');
this.close_();
- return;
+ break;
}
};
« no previous file with comments | « chrome/browser/resources/file_manager/css/action_choice.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698