mirror of
https://github.com/google/nomulus.git
synced 2025-06-21 03:40:47 +02:00
Don't rely on the password field's existence for admins (#534)
* Don't rely on the password field's existence for admins We don't have the field when it's an admin user that's logged in. A nicer language would have caught this unfortunately.
This commit is contained in:
parent
507aee7f30
commit
b9d846cd42
1 changed files with 6 additions and 2 deletions
|
@ -121,7 +121,10 @@ registry.registrar.RegistryLock.prototype.showModal_ = function(targetElement, d
|
||||||
if (domain == null) {
|
if (domain == null) {
|
||||||
goog.dom.getRequiredElement('domain-lock-input-value').focus();
|
goog.dom.getRequiredElement('domain-lock-input-value').focus();
|
||||||
} else {
|
} else {
|
||||||
goog.dom.getRequiredElement('domain-lock-password').focus();
|
var passwordElem = goog.dom.getElement('domain-lock-password');
|
||||||
|
if (passwordElem != null) {
|
||||||
|
passwordElem.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// delete the modal when the user clicks the cancel button
|
// delete the modal when the user clicks the cancel button
|
||||||
goog.events.listen(
|
goog.events.listen(
|
||||||
|
@ -162,7 +165,8 @@ registry.registrar.RegistryLock.prototype.showModal_ = function(targetElement, d
|
||||||
*/
|
*/
|
||||||
registry.registrar.RegistryLock.prototype.lockOrUnlockDomain_ = function(isLock, e) {
|
registry.registrar.RegistryLock.prototype.lockOrUnlockDomain_ = function(isLock, e) {
|
||||||
var domain = goog.dom.getRequiredElement('domain-lock-input-value').value;
|
var domain = goog.dom.getRequiredElement('domain-lock-input-value').value;
|
||||||
var password = goog.dom.getRequiredElement('domain-lock-password').value;
|
var passwordElem = goog.dom.getElement('domain-lock-password');
|
||||||
|
var password = passwordElem == null ? null : passwordElem.value;
|
||||||
goog.net.XhrIo.send('/registry-lock-post',
|
goog.net.XhrIo.send('/registry-lock-post',
|
||||||
e => this.fillLocksPage_(e),
|
e => this.fillLocksPage_(e),
|
||||||
'POST',
|
'POST',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue