summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-01-03 06:24:51 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-01-03 06:24:51 +0100
commit160e1e1882cb0bf40fb14f88f493d39e85f7dbc1 (patch)
tree8dc8acc8e93c0eb66a4a80ab06e8aa48fc98f375 /settings/js
parent023e7c5594cafc33a2e96b1ec4872d51346203e0 (diff)
downloadnextcloud-server-160e1e1882cb0bf40fb14f88f493d39e85f7dbc1.tar.gz
nextcloud-server-160e1e1882cb0bf40fb14f88f493d39e85f7dbc1.zip
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>
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users/users.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 7b98af985ac..1d6cb93452a 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -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');
});