Commit 2f7381f1 authored by ivankr@chromium.org's avatar ivankr@chromium.org

[cros] Double-click fixes on Change Picture prefs page.


BUG=chromium-os:23326
TEST=Manual


Review URL: http://codereview.chromium.org/8636015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111196 0039d316-1c4b-4281-b951-d872f2087c98
parent a2caa234
...@@ -8,6 +8,15 @@ cr.define('options', function() { ...@@ -8,6 +8,15 @@ cr.define('options', function() {
var UserImagesGrid = options.UserImagesGrid; var UserImagesGrid = options.UserImagesGrid;
var ButtonImages = UserImagesGrid.ButtonImages; 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: // ChangePictureOptions class:
...@@ -88,6 +97,7 @@ cr.define('options', function() { ...@@ -88,6 +97,7 @@ cr.define('options', function() {
* @private * @private
*/ */
closePage_: function() { closePage_: function() {
$('images-grid').blur(); // Make sure the image grid is not active.
OptionsPage.navigateToPage('personal'); OptionsPage.navigateToPage('personal');
}, },
...@@ -121,8 +131,6 @@ cr.define('options', function() { ...@@ -121,8 +131,6 @@ cr.define('options', function() {
case ButtonImages.CHOOSE_FILE: case ButtonImages.CHOOSE_FILE:
this.handleChooseFile_(); this.handleChooseFile_();
break; break;
case ButtonImages.PROFILE_PICTURE:
break;
default: default:
this.closePage_(); this.closePage_();
break; break;
...@@ -134,16 +142,11 @@ cr.define('options', function() { ...@@ -134,16 +142,11 @@ cr.define('options', function() {
* @param {Event} e Double click Event. * @param {Event} e Double click Event.
*/ */
handleImageDblClick_: function(e) { handleImageDblClick_: function(e) {
// Close page unless the click target is the grid itself, // Close page unless the click target is the grid itself or
// any of the buttons or the Profile image until it's not loaded. // any of the buttons.
var url = e.target.src; var url = e.target.src;
if (!url) if (url && ButtonImageUrls.indexOf(url) == -1)
return; this.closePage_();
for (var k in ButtonImages) {
if (url == ButtonImages[k])
return;
}
this.closePage_();
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment