From 5b352275be451989dcd5af3d7e95d32d3af88c92 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 27 Oct 2020 18:20:12 +0100 Subject: [PATCH] fixes #1244 easier exit easier exit out of the group list window via escp or right click outside, also added clearer message of whichi user is added when adding a user inside a group --- admin/themes/default/js/group_list.js | 5 ++++- admin/themes/default/template/group_list.tpl | 11 +++++++++++ admin/themes/default/theme.css | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/js/group_list.js b/admin/themes/default/js/group_list.js index fd1e0ad68..08355e3e2 100644 --- a/admin/themes/default/js/group_list.js +++ b/admin/themes/default/js/group_list.js @@ -822,6 +822,7 @@ var getUserDisplay = function(username, user_id, grp_id) { dissociateUserInfo.find("p").html(str); dissociateUserInfo.fadeIn() + $(".UsernameBlock").css("margin-right", "10px").css("border", "none"); userBlock.remove() updateUserSearch(); @@ -884,7 +885,9 @@ $(".AddUserBlock button").on("click", function () { let userBlock = getUserDisplay(username, id, grp_id).prependTo(".UsersInGroupList"); dissociateUserInfo.fadeOut() - + + $(".UsernameBlock:first").css("margin-right", "0px").css("border", "2px solid #c2f5c2"); + $(".UsernameBlock").slice(1).css("margin-right", "10px").css("border", "none"); associateUserInfo.remove() associateUserInfo.insertAfter(userBlock); associateUserInfo.find("p").html(str_user_associated); diff --git a/admin/themes/default/template/group_list.tpl b/admin/themes/default/template/group_list.tpl index 345b0df69..e612e273c 100644 --- a/admin/themes/default/template/group_list.tpl +++ b/admin/themes/default/template/group_list.tpl @@ -22,6 +22,17 @@ var str_other_copy = '{' (copy %s)'|@translate}' var serverKey = '{$CACHE_KEYS.users}' var serverId = '{$CACHE_KEYS._hash}' var rootUrl = '{$ROOT_URL}' + +$(document).on('keydown', function (e) { + if ( e.keyCode === 27) { // ESC button + $("#UserList").fadeOut(); + } +}) +$(document).on('click', function (e) { + if ($(e.target).closest(".UserListPopInContainer").length === 0) { + $("#UserList").fadeOut(); + } +}); {/footer_script} {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index f755b4ef2..ca63ded32 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -4268,7 +4268,8 @@ input:checked + .slider:before { font-size:12px; text-align:left; padding: 4px 6px; - border-radius:10px; + border-top-right-radius:10px; + border-bottom-right-radius:10px; margin-left:-5px; margin-right:10px; }