Merge pull request #1368 from Ma27/login-submit-btn
Use `submit` event in login form
This commit is contained in:
commit
b676b08fac
|
@ -33,7 +33,7 @@
|
||||||
<div id="hydra-signin" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
|
<div id="hydra-signin" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<form>
|
<form id="signin-form">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username" class="col-form-label">User name</label>
|
<label for="username" class="col-form-label">User name</label>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button id="do-signin" type="button" class="btn btn-primary">Sign in</button>
|
<button type="submit" class="btn btn-primary">Sign in</button>
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -57,10 +57,11 @@
|
||||||
|
|
||||||
function finishSignOut() { }
|
function finishSignOut() { }
|
||||||
|
|
||||||
$("#do-signin").click(function() {
|
$("#signin-form").submit(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
requestJSON({
|
requestJSON({
|
||||||
url: "[% c.uri_for('/login') %]",
|
url: "[% c.uri_for('/login') %]",
|
||||||
data: $(this).parents("form").serialize(),
|
data: $(this).serialize(),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
Loading…
Reference in a new issue