Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

click_handler: Use a variable for target's jquery instance.

Aman Agrawalb3886af651b3
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 8ea8a975134..36c2fd3e9b2 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -647,16 +647,15 @@ export function initialize() {
});
function handle_compose_click(e) {
+ const $target = $(e.target);
// Emoji clicks should be handled by their own click handler in emoji_picker.js
- if (
- $(e.target).is(".emoji_map, img.emoji, .drag, .compose_gif_icon, .compose_control_menu")
- ) {
+ if ($target.is(".emoji_map, img.emoji, .drag, .compose_gif_icon, .compose_control_menu")) {
return;
}
// The mobile compose button has its own popover when clicked, so it already.
// hides other popovers.
- if ($(e.target).is(".compose_mobile_button, .compose_mobile_button *")) {
+ if ($target.is(".compose_mobile_button, .compose_mobile_button *")) {
return;
}
@@ -670,7 +669,7 @@ export function initialize() {
// clicking "Press Enter to send" should not
// trigger the composebox-closing code in MAIN CLICK HANDLER.
// But do allow our formatting link.
- if (!$(e.target).is("a")) {
+ if (!$target.is("a")) {
e.stopPropagation();
}
// Still hide the popovers, however