From 40ad01371fa2828a5a577da66e550e50d5fba1c3 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Fri, 4 Oct 2013 14:20:56 -0400 Subject: [PATCH] Don't close the compose box on right click in Firefox. Trac #1737 Firefox has the slightly broken behavior that it emits a click event on the document when you right click, but not on any of the child nodes, so our #compose stopPropagation doesn't stop right-click events from closing compose. Chrome never emits click events on right click. (imported from commit 2519c542715c93877b6d38e5dcff1f3e011688e4) --- static/js/ui.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/ui.js b/static/js/ui.js index 4504821354..9c074a33a0 100644 --- a/static/js/ui.js +++ b/static/js/ui.js @@ -1522,6 +1522,13 @@ $(function () { // End Webathena code $(document).on('click', function (e) { + if (e.button !== 0) { + // Firefox emits right click events on the document, but not on + // the child nodes, so the #compose stopPropagation doesn't get a + // chance to capture right clicks. + return; + } + // Dismiss popovers if the user has clicked outside them if ($('.popover-inner').has(e.target).length === 0) { popovers.hide_all();