diff options
author | giorgia <g.sambrotta@gmail.com> | 2017-03-03 14:44:16 +0100 |
---|---|---|
committer | giorgia <g.sambrotta@gmail.com> | 2017-03-03 14:47:47 +0100 |
commit | 3afc16bf772465e80b9e9fdb728b55e32bbd7a7d (patch) | |
tree | f9b0b442e07333d863862d0457ce121474fe5e90 /settings | |
parent | abc48f9e91fc117c8f6d0fcf7849ffca9489248b (diff) | |
download | nextcloud-server-3afc16bf772465e80b9e9fdb728b55e32bbd7a7d.tar.gz nextcloud-server-3afc16bf772465e80b9e9fdb728b55e32bbd7a7d.zip |
clean search when new user is added
Signed-off-by: giorgia <g.sambrotta@gmail.com>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/users/users.js | 23 | ||||
-rw-r--r-- | settings/templates/users/part.userlist.php | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 8edc20e3e2b..46bfea4b35c 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -10,6 +10,7 @@ var $userList; var $userListBody; +var $emptyContainer; var UserDeleteHandler; var UserList = { @@ -383,7 +384,6 @@ var UserList = { } UserList.currentGid = gid; var pattern = this.filter; - var emptyContainer = $userList.siblings('.emptycontent'); $.get( OC.generateUrl('/settings/users/users'), { offset: UserList.offset, limit: limit, gid: gid, pattern: pattern }, @@ -404,15 +404,18 @@ var UserList = { // reset state on load UserList.noMoreEntries = false; $userListHead.show(); - emptyContainer.hide(); - emptyContainer.find('h2 strong').html(); + $emptyContainer.hide(); + $emptyContainer.find('h2').text(''); } else { UserList.noMoreEntries = true; $userList.siblings('.loading').remove(); - $userListHead.hide(); - emptyContainer.show(); - emptyContainer.find('h2 strong').html(pattern); + + if (pattern !== ""){ + $userListHead.hide(); + $emptyContainer.show(); + $emptyContainer.find('h2').html(t('settings', 'No user found for <strong>{pattern}</strong>', {pattern: pattern})); + } } UserList.offset += limit; }).always(function() { @@ -677,6 +680,7 @@ $(document).ready(function () { $userList = $('#userlist'); $userListBody = $userList.find('tbody'); $userListHead = $userList.find('thead'); + $emptyContainer = $userList.siblings('.emptycontent'); UserList.initDeleteHandling(); @@ -908,6 +912,13 @@ $(document).ready(function () { $(this).find('#default_quota').singleSelect().on('change', UserList.onQuotaSelect); }); + $('#newuser input').click(function() { + // empty the container also here to avoid visual delay + $emptyContainer.hide(); + OC.Search = new OCA.Search($('#searchbox'), $('#searchresults')); + OC.Search.clear(); + }); + UserList._updateGroupListLabel($('#newuser .groups'), []); var _submitNewUserForm = function (event) { event.preventDefault(); diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php index 12adbb9f30a..7e7e1561e2f 100644 --- a/settings/templates/users/part.userlist.php +++ b/settings/templates/users/part.userlist.php @@ -70,5 +70,5 @@ <div class="emptycontent" style="display:none"> <div class="icon-search"></div> - <h2><?php p($l->t("No user found for '"));?><strong></strong>' </h2> + <h2></h2> </div> |