invite: Fix compose box focus on clicking (Un)check All in invite window.

Fixes #16077.
This commit is contained in:
Abhijeet Prasad Bodas 2020-08-11 19:34:16 +05:30 committed by Tim Abbott
parent e5054a3a66
commit 49fd272d7d
2 changed files with 5 additions and 7 deletions

View File

@ -100,7 +100,7 @@ function submit_invitation_form() {
complete() {
$("#submit-invitation").button("reset");
$("#invitee_emails").focus();
ui.get_scroll_element($('#invite_user_form .modal-body'))[0].scrollTop = 0;
ui.get_scroll_element($("#invite_user_form .modal-body"))[0].scrollTop = 0;
},
});
}
@ -176,14 +176,12 @@ exports.launch = function () {
};
exports.initialize = function () {
$(document).on("click", ".invite_check_all_button", (e) => {
$(document).on("click", "#invite_check_all_button", () => {
$("#streams_to_add :checkbox").prop("checked", true);
e.preventDefault();
});
$(document).on("click", ".invite_uncheck_all_button", (e) => {
$(document).on("click", "#invite_uncheck_all_button", () => {
$("#streams_to_add :checkbox").prop("checked", false);
e.preventDefault();
});
$("#submit-invitation").on("click", () => {

View File

@ -1,7 +1,7 @@
{{! Client-side Mustache template for rendering subscriptions in the "invite user" form.}}
<div class="invite-stream-controls">
<a href="#" class="invite_check_all_button">{{t "Check all" }}</a> |
<a href="#" class="invite_uncheck_all_button">{{t "Uncheck all" }}</a>
<button class="btn btn-link" type="button" id="invite_check_all_button">{{t "Check all" }}</button> |
<button class="btn btn-link" type="button" id="invite_uncheck_all_button">{{t "Uncheck all" }}</button>
</div>
<div id="invite-stream-checkboxes" class="new-style">
{{#each streams}}