add emptycontent div, show/hide emptycontent div, fix #1070

Signed-off-by: giorgia <g.sambrotta@gmail.com>
This commit is contained in:
giorgia 2017-03-01 21:09:03 +01:00
parent 53a484ede6
commit abc48f9e91
2 changed files with 14 additions and 0 deletions

View File

@ -383,6 +383,7 @@ var UserList = {
} }
UserList.currentGid = gid; UserList.currentGid = gid;
var pattern = this.filter; var pattern = this.filter;
var emptyContainer = $userList.siblings('.emptycontent');
$.get( $.get(
OC.generateUrl('/settings/users/users'), OC.generateUrl('/settings/users/users'),
{ offset: UserList.offset, limit: limit, gid: gid, pattern: pattern }, { offset: UserList.offset, limit: limit, gid: gid, pattern: pattern },
@ -396,15 +397,22 @@ var UserList = {
} }
UserList.add(user); UserList.add(user);
}); });
if (result.length > 0) { if (result.length > 0) {
UserList.doSort(); UserList.doSort();
$userList.siblings('.loading').css('visibility', 'hidden'); $userList.siblings('.loading').css('visibility', 'hidden');
// reset state on load // reset state on load
UserList.noMoreEntries = false; UserList.noMoreEntries = false;
$userListHead.show();
emptyContainer.hide();
emptyContainer.find('h2 strong').html();
} }
else { else {
UserList.noMoreEntries = true; UserList.noMoreEntries = true;
$userList.siblings('.loading').remove(); $userList.siblings('.loading').remove();
$userListHead.hide();
emptyContainer.show();
emptyContainer.find('h2 strong').html(pattern);
} }
UserList.offset += limit; UserList.offset += limit;
}).always(function() { }).always(function() {
@ -668,6 +676,7 @@ var UserList = {
$(document).ready(function () { $(document).ready(function () {
$userList = $('#userlist'); $userList = $('#userlist');
$userListBody = $userList.find('tbody'); $userListBody = $userList.find('tbody');
$userListHead = $userList.find('thead');
UserList.initDeleteHandling(); UserList.initDeleteHandling();

View File

@ -67,3 +67,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="emptycontent" style="display:none">
<div class="icon-search"></div>
<h2><?php p($l->t("No user found for '"));?><strong></strong>' </h2>
</div>