From 49fd272d7d7ab5a685be6e3881948c609cfb1c06 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Bodas Date: Tue, 11 Aug 2020 19:34:16 +0530 Subject: [PATCH] invite: Fix compose box focus on clicking (Un)check All in invite window. Fixes #16077. --- static/js/invite.js | 8 +++----- static/templates/invite_subscription.hbs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/static/js/invite.js b/static/js/invite.js index a08cd4ea6b..af25aa926c 100644 --- a/static/js/invite.js +++ b/static/js/invite.js @@ -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", () => { diff --git a/static/templates/invite_subscription.hbs b/static/templates/invite_subscription.hbs index cf416fe590..9ac969404a 100644 --- a/static/templates/invite_subscription.hbs +++ b/static/templates/invite_subscription.hbs @@ -1,7 +1,7 @@ {{! Client-side Mustache template for rendering subscriptions in the "invite user" form.}}
- {{t "Check all" }} | - {{t "Uncheck all" }} + | +
{{#each streams}}