proper fix for focus and some styling of the form and allows for pressing enter on form so generally a better fix
parent
de5a90b9c7
commit
fddca354b3
|
@ -305,14 +305,22 @@ function handshake()
|
|||
else if(obj.accessStatus == "needPassword")
|
||||
{
|
||||
$("#editorloadingbox").html("<b>You need a password to access this pad</b><br>" +
|
||||
"<input id='passwordinput' type='password' name='password'>"+
|
||||
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button>");
|
||||
"<form class='passForm'><input id='passwordinput' type='password' name='password'>"+
|
||||
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword();") + "\">ok</button></div>");
|
||||
$("#passwordinput").focus();
|
||||
$(".passForm").submit(function(){
|
||||
$('.passForm button').click();
|
||||
});
|
||||
}
|
||||
else if(obj.accessStatus == "wrongPassword")
|
||||
{
|
||||
$("#editorloadingbox").html("<b>Your password was wrong</b><br>" +
|
||||
"<input id='passwordinput' type='password' name='password'>"+
|
||||
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword()") + "\">ok</button>");
|
||||
"<form class='passForm'><input id='passwordinput' type='password' name='password'>"+
|
||||
"<button type='button' onclick=\"" + padutils.escapeHtml('require('+JSON.stringify(module.id)+").savePassword();") + "\">ok</button></div>");
|
||||
$("#passwordinput").focus();
|
||||
$(".passForm").submit(function(){
|
||||
$('.passForm button').click();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue