diff options
author | Dominik <prodinger.d@outlook.com> | 2017-12-29 20:45:03 +0300 |
---|---|---|
committer | Dominik <prodinger.d@outlook.com> | 2017-12-29 20:45:03 +0300 |
commit | 45e1d490c92270a7f9d452cf3d8966b5f0bef32c (patch) | |
tree | c31dc4518854e10dde6bc70ea3416ab5bec31e56 /js | |
parent | a8c7f7ee063769fd7d4e3ab61237b1e28b34a1dd (diff) |
Move Impersonate-Button to Dropdown
Addresses #4, #8 and #9
Signed-off-by: Dominik Prodinger <prodinger.d@outlook.com>
Diffstat (limited to 'js')
-rw-r--r-- | js/impersonate.js | 13 |
1 files changed, 5 insertions, 8 deletions
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"); - $('<th id="impersonateId" scope="col">'+t('impersonate', 'Impersonate') +'</th>').insertAfter($newColumn.find("#headerName")); - $('<td><a class="action permanent impersonate" href="#" title="' + - t('impersonate', 'Impersonate') + '">' + - '<img class="svg permanent action" src="' + OC.imagePath('core','actions/user.svg') + '" />' + - '</a></td>') - .insertAfter('#userlist .name'); - $('#userlist').on('click', '.impersonate', function() { + $('<li><a href="#" class="menuitem permanent impersonate">' + + '<span class="icon icon-user"></span><span>Impersonate</span></a></li>').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}), |