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() {
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_();
},
/**
......
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