mirror of https://github.com/zulip/zulip.git
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)
This commit is contained in:
parent
8c081bceb2
commit
40ad01371f
|
@ -1522,6 +1522,13 @@ $(function () {
|
||||||
// End Webathena code
|
// End Webathena code
|
||||||
|
|
||||||
$(document).on('click', function (e) {
|
$(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
|
// Dismiss popovers if the user has clicked outside them
|
||||||
if ($('.popover-inner').has(e.target).length === 0) {
|
if ($('.popover-inner').has(e.target).length === 0) {
|
||||||
popovers.hide_all();
|
popovers.hide_all();
|
||||||
|
|
Loading…
Reference in New Issue