From 45e1d490c92270a7f9d452cf3d8966b5f0bef32c Mon Sep 17 00:00:00 2001 From: Dominik Date: Fri, 29 Dec 2017 18:45:03 +0100 Subject: Move Impersonate-Button to Dropdown Addresses #4, #8 and #9 Signed-off-by: Dominik Prodinger --- js/impersonate.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'js') diff --git a/js/impersonate.js b/js/impersonate.js index a49f5e2..af54387 100644 --- a/js/impersonate.js +++ b/js/impersonate.js @@ -15,15 +15,12 @@ OC.dialogs.alert(result.responseJSON.message, t('impersonate', 'Could not impersonate user')); }); } - var $newColumn = $("#userlist").find("tr:first-child"); - $(''+t('impersonate', 'Impersonate') +'').insertAfter($newColumn.find("#headerName")); - $('' + - '' + - '') - .insertAfter('#userlist .name'); - $('#userlist').on('click', '.impersonate', function() { + $('
  • ' + + 'Impersonate
  • ').insertAfter( + $(".userActionsMenu").find("li:last-child")); + + $('body').on('click', '.impersonate', function() { var userId = $(this).parents('tr').find('.name').text(); OCdialogs.confirm( t('impersonate', 'Are you sure you want to impersonate "{userId}"?', {userId: userId}), -- cgit v1.2.3