Commit f5e6ffac authored by antrim@chromium.org's avatar antrim@chromium.org

Fix next button status, error bubble positions, initial focus on user name screen.

BUG=268271
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/22896002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217034 0039d316-1c4b-4281-b951-d872f2087c98
parent 0aaa839d
...@@ -529,7 +529,7 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -529,7 +529,7 @@ login.createScreen('LocallyManagedUserCreationScreen',
* @private * @private
*/ */
checkUserName_: function() { checkUserName_: function() {
var userName = $('managed-user-creation-name').value; var userName = this.getScreenElement('name').value;
// Avoid flickering // Avoid flickering
if (userName == this.lastIncorrectUserName_ || if (userName == this.lastIncorrectUserName_ ||
...@@ -542,6 +542,7 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -542,6 +542,7 @@ login.createScreen('LocallyManagedUserCreationScreen',
this.nameErrorVisible = false; this.nameErrorVisible = false;
this.lastVerifiedName_ = null; this.lastVerifiedName_ = null;
this.lastIncorrectUserName_ = null; this.lastIncorrectUserName_ = null;
this.updateNextButtonForUser_();
} }
}, },
...@@ -554,7 +555,7 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -554,7 +555,7 @@ login.createScreen('LocallyManagedUserCreationScreen',
this.lastIncorrectUserName_ = null; this.lastIncorrectUserName_ = null;
if ($('managed-user-creation-name').value == name) if ($('managed-user-creation-name').value == name)
this.clearUserNameError_(); this.clearUserNameError_();
this.updateNextButtonForManager_(); this.updateNextButtonForUser_();
}, },
/** /**
...@@ -573,7 +574,7 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -573,7 +574,7 @@ login.createScreen('LocallyManagedUserCreationScreen',
$('managed-user-creation-name'), $('managed-user-creation-name'),
errorText, errorText,
cr.ui.Bubble.Attachment.RIGHT, cr.ui.Bubble.Attachment.RIGHT,
24, 4); 12, 4);
this.setButtonDisabledStatus('next', true); this.setButtonDisabledStatus('next', true);
} }
}, },
...@@ -600,7 +601,7 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -600,7 +601,7 @@ login.createScreen('LocallyManagedUserCreationScreen',
$('managed-user-creation-password'), $('managed-user-creation-password'),
errorText, errorText,
cr.ui.Bubble.Attachment.RIGHT, cr.ui.Bubble.Attachment.RIGHT,
24, 4); 12, 4);
$('managed-user-creation-password').classList.add('password-error'); $('managed-user-creation-password').classList.add('password-error');
$('managed-user-creation-password').focus(); $('managed-user-creation-password').focus();
this.disabled = false; this.disabled = false;
...@@ -638,12 +639,12 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -638,12 +639,12 @@ login.createScreen('LocallyManagedUserCreationScreen',
* @private * @private
*/ */
updateNextButtonForUser_: function() { updateNextButtonForUser_: function() {
var firstPassword = $('managed-user-creation-password').value; var firstPassword = this.getScreenElement('password').value;
var secondPassword = var secondPassword = this.getScreenElement('password-confirm').value;
$('managed-user-creation-password-confirm').value; var userName = this.getScreenElement('name').value;
var userName = $('managed-user-creation-name').value;
var canProceed = var canProceed =
(userName.length > 0) &&
(firstPassword.length > 0) && (firstPassword.length > 0) &&
(firstPassword.length == secondPassword.length) && (firstPassword.length == secondPassword.length) &&
this.lastVerifiedName_ && this.lastVerifiedName_ &&
...@@ -716,6 +717,8 @@ login.createScreen('LocallyManagedUserCreationScreen', ...@@ -716,6 +717,8 @@ login.createScreen('LocallyManagedUserCreationScreen',
chrome.send('supervisedUserSelectImage', chrome.send('supervisedUserSelectImage',
[selected.url, 'default']); [selected.url, 'default']);
this.getScreenElement('image-grid').redraw(); this.getScreenElement('image-grid').redraw();
this.updateNextButtonForUser_();
this.getScreenElement('name').focus();
} }
}, },
......
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