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: Open channel links in a new tab on modified click.

Apoorva Pendsee5f05c64541d
diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts
index 75041f14452..0082162fbc5 100644
--- a/web/src/click_handlers.ts
+++ b/web/src/click_handlers.ts
@@ -295,6 +295,11 @@ export function initialize(): void {
});
$("#main_div").on("click", "a.stream", function (this: HTMLAnchorElement, e) {
+ if (e.metaKey || e.ctrlKey || e.shiftKey) {
+ // Let the browser handle modified clicks (open in a new
+ // tab/window) using the link's href.
+ return;
+ }
e.preventDefault();
// Note that we may have an href here, but we trust the stream id more,
// so we re-encode the hash.