Use form submition for login/password
The browser manage itself the Return key and also it can store the password. review11011002
This commit is contained in:
+6
-6
@@ -70,7 +70,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
</script>
|
||||
<div class="modal fade" id="login">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Login</h4>
|
||||
</div>
|
||||
@@ -89,14 +89,14 @@ this repository contains the full copyright notices and license terms. -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary">Login</button>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="password">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Password</h4>
|
||||
</div>
|
||||
@@ -107,9 +107,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary">OK</button>
|
||||
<button type="submit" class="btn btn-primary">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+2
-15
@@ -138,11 +138,6 @@
|
||||
login_modal.modal('hide');
|
||||
};
|
||||
|
||||
var keydown = function(ev) {
|
||||
if (ev.which === 13)
|
||||
ok_func();
|
||||
};
|
||||
|
||||
var fill_database = function() {
|
||||
jQuery.when(Sao.DB.list()).then(function(databases) {
|
||||
databases.forEach(function(database) {
|
||||
@@ -163,9 +158,6 @@
|
||||
fill_database();
|
||||
}
|
||||
|
||||
jQuery('#login-login').keydown(keydown);
|
||||
jQuery('#login-password').keydown(keydown);
|
||||
|
||||
login_modal.modal({
|
||||
backdrop: false,
|
||||
keyboard: false
|
||||
@@ -178,7 +170,7 @@
|
||||
jQuery('#login-database').focus();
|
||||
}
|
||||
});
|
||||
login_modal.find('button').click(ok_func);
|
||||
login_modal.find('form').submit(ok_func);
|
||||
};
|
||||
|
||||
Sao.Session.renew = function(session) {
|
||||
@@ -195,13 +187,8 @@
|
||||
});
|
||||
password_modal.modal('hide');
|
||||
};
|
||||
var keydown = function(ev) {
|
||||
if (ev.which === 13)
|
||||
ok_func();
|
||||
};
|
||||
|
||||
password_modal = jQuery('#password');
|
||||
jQuery('#password-password').keydown(keydown);
|
||||
password_modal.modal({
|
||||
backdrop: false,
|
||||
keyboard: false
|
||||
@@ -210,7 +197,7 @@
|
||||
password_modal.on('show.bs.modal', function() {
|
||||
jQuery('#password-password').focus();
|
||||
});
|
||||
password_modal.find('#button').click(ok_func);
|
||||
password_modal.find('form').submit(ok_func);
|
||||
return dfd.promise();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user