mirror of https://github.com/zulip/zulip.git
user status: Save status on enter keypress.
This is a common UX pattern for forms - a user would expect the input to be submitted on hitting enter. So, create a 'keypress' event listener on the input field for the new status, which calls 'submit_new_status' on enter key press.
This commit is contained in:
parent
40a6602b09
commit
043b55b5af
|
@ -82,6 +82,14 @@ exports.initialize = function () {
|
|||
exports.submit_new_status();
|
||||
});
|
||||
|
||||
$('body').on('keypress', '.user_status_overlay .user_status', function (event) {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
|
||||
exports.submit_new_status();
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('keyup', '.user_status_overlay input.user_status', function () {
|
||||
exports.update_button();
|
||||
exports.toggle_clear_message_button();
|
||||
|
|
Loading…
Reference in New Issue