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_handlers: Prevent compose opening when copying code blocks.

Aryan Shridhar1b5a16bd1f2d
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 3428d8bedf8..20bbc6b2058 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -132,6 +132,13 @@ export function initialize() {
return true;
}
+ // Ideally, this should be done via ClipboardJS, but it does't support
+ // feature of stopPropagation once clicked.
+ // See https://github.com/zenorocha/clipboard.js/pull/475
+ if (target.is(".copy_codeblock") || target.parents(".copy_codeblock").length > 0) {
+ return true;
+ }
+
return false;
}