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

Unified Diff: chrome/browser/resources/options/chromeos/change_picture_options.js

Issue 8636015: [cros] Double-click fixes on Change Picture prefs page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/options/chromeos/change_picture_options.js
diff --git a/chrome/browser/resources/options/chromeos/change_picture_options.js b/chrome/browser/resources/options/chromeos/change_picture_options.js
index f2169777c8fefa5a6a69dcf61ed1532f2242e9de..b41d625395dd6f5f84517e903cdfed98aa28fe48 100644
--- a/chrome/browser/resources/options/chromeos/change_picture_options.js
+++ b/chrome/browser/resources/options/chromeos/change_picture_options.js
@@ -8,6 +8,15 @@ cr.define('options', function() {
var UserImagesGrid = options.UserImagesGrid;
var ButtonImages = UserImagesGrid.ButtonImages;
+ /**
+ * Array of button URLs used on this page.
+ * @type {Array.<string>}
+ */
+ const ButtonImageUrls = [
+ ButtonImages.TAKE_PHOTO,
+ ButtonImages.CHOOSE_FILE
+ ];
+
/////////////////////////////////////////////////////////////////////////////
// ChangePictureOptions class:
@@ -88,6 +97,7 @@ cr.define('options', function() {
* @private
*/
closePage_: function() {
+ $('images-grid').blur(); // Make sure the image grid is not active.
OptionsPage.navigateToPage('personal');
},
@@ -121,8 +131,6 @@ cr.define('options', function() {
case ButtonImages.CHOOSE_FILE:
this.handleChooseFile_();
break;
- case ButtonImages.PROFILE_PICTURE:
- break;
default:
this.closePage_();
break;
@@ -134,16 +142,11 @@ cr.define('options', function() {
* @param {Event} e Double click Event.
*/
handleImageDblClick_: function(e) {
- // Close page unless the click target is the grid itself,
- // any of the buttons or the Profile image until it's not loaded.
+ // Close page unless the click target is the grid itself or
+ // any of the buttons.
var url = e.target.src;
- if (!url)
- return;
- for (var k in ButtonImages) {
- if (url == ButtonImages[k])
- return;
- }
- this.closePage_();
+ if (url && ButtonImageUrls.indexOf(url) == -1)
+ this.closePage_();
},
/**
« 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