mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
allows the submission of the create account form by pressing enter
This commit is contained in:
parent
3d7dfd3168
commit
4a9c30bf33
|
@ -276,8 +276,19 @@ Discourse.CreateAccountView = Discourse.ModalBodyView.extend({
|
|||
_this.set('formSubmitted', false);
|
||||
return _this.flash(Em.String.i18n('create_account.failed'), 'error');
|
||||
});
|
||||
},
|
||||
|
||||
didInsertElement: function(e) {
|
||||
// allows the submission the form when pressing 'ENTER' on *any* text input field
|
||||
// but only when the submit button is enabled
|
||||
var _this = this;
|
||||
return Em.run.next(function() {
|
||||
return $("input[type='text']").keydown(function(e) {
|
||||
if (_this.get('submitDisabled') === false && e.keyCode === 13) {
|
||||
return _this.createAccount();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user