From 78e4fe659491f142bb7cac41f5000ec0848c31f5 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 10 Oct 2013 17:30:39 -0400 Subject: [PATCH] Support command-click for stream/topic links. Allow users to open Zulip windows in new tabs with command-click from the left sidebar narrowing links and recipient bar narrowing links. (imported from commit d60c038c7bf1efccd461f5284d513b9cbfbdaebf) --- static/js/ui.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/js/ui.js b/static/js/ui.js index 4405a39131..2e428336f3 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -1208,12 +1208,18 @@ $(function () { } $("#home").on("click", ".narrows_by_recipient", function (e) { + if (e.metaKey || e.ctrlKey) { + return; + } e.preventDefault(); var row_id = get_row_id_for_narrowing(this); narrow.by_recipient(row_id, {trigger: 'message header'}); }); $("#home").on("click", ".narrows_by_subject", function (e) { + if (e.metaKey || e.ctrlKey) { + return; + } e.preventDefault(); var row_id = get_row_id_for_narrowing(this); narrow.by_subject(row_id, {trigger: 'message header'}); @@ -1335,6 +1341,9 @@ $(function () { }); $('#stream_filters li').on('click', '.subscription_block', function (e) { + if (e.metaKey || e.ctrlKey) { + return; + } if (exports.home_tab_obscured()) { ui.change_tab_to('#home'); } @@ -1348,6 +1357,9 @@ $(function () { popovers.register_click_handlers(); $('#stream_filters').on('click', '.subject_box', function (e) { + if (e.metaKey || e.ctrlKey) { + return; + } if (exports.home_tab_obscured()) { ui.change_tab_to('#home'); }