Close menu on "mouseup" instead of on "click" events in the document

"click" events are handled by several elements in user settings, and
some of them (like the edit icon in the user name) stop the propagation
of the event. Due to this the event never reaches the document and thus
the menu was not closed in those cases. "click" events are always
preceded by "mouseup" events (as "click" events are generated when
"mousedown" and "mouseup" events occur in the same element), so now the
menu is closed when a "mouseup" is received in the document.

The described problem would happen too if an element stopped the
propagation of the "mouseup" event; currently no element does that in
the user settings, so now the menu is always closed as expected.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2018-01-03 06:24:51 +01:00
parent 023e7c5594
commit 160e1e1882
1 changed files with 1 additions and 1 deletions

View File

@ -970,7 +970,7 @@ $(document).ready(function () {
$tr.addClass('active');
});
$(document.body).click(function () {
$(document).on('mouseup', function () {
$('#userlist tr.active').removeClass('active');
$('#userlist .popovermenu.open').removeClass('open');
});