diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-13 11:00:48 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-13 11:00:48 +0100 |
commit | ca4f24aa97e275f5887470c92851e4bc4e4021da (patch) | |
tree | f9ef7fb72a2612e192cf3ba22cbf285f6c7c6008 /settings | |
parent | 4ce45c245a6cb0341b82430f251f4af158f76751 (diff) | |
parent | 44f4195eee44d2cfac4e7e91afe5d25ec807a6b2 (diff) | |
download | nextcloud-server-ca4f24aa97e275f5887470c92851e4bc4e4021da.tar.gz nextcloud-server-ca4f24aa97e275f5887470c92851e4bc4e4021da.zip |
Merge pull request #21509 from owncloud/users-scrolltop
Keep scroll position in users page when sorting
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/users/users.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index aea94053572..151ab6cdecc 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -259,6 +259,10 @@ var UserList = { } }, doSort: function() { + // some browsers like Chrome lose the scrolling information + // when messing with the list elements + var lastScrollTop = this.scrollArea.scrollTop(); + var lastScrollLeft = this.scrollArea.scrollLeft(); var rows = $userListBody.find('tr').get(); rows.sort(function(a, b) { @@ -284,6 +288,8 @@ var UserList = { if(items.length > 0) { $userListBody.append(items); } + this.scrollArea.scrollTop(lastScrollTop); + this.scrollArea.scrollLeft(lastScrollLeft); }, checkUsersToLoad: function() { //30 shall be loaded initially, from then on always 10 upon scrolling @@ -605,10 +611,11 @@ $(document).ready(function () { // Implements User Search OCA.Search.users= new UserManagementFilter(UserList, GroupList); + UserList.scrollArea = $('#app-content'); + UserList.doSort(); UserList.availableGroups = $userList.data('groups'); - UserList.scrollArea = $('#app-content'); UserList.scrollArea.scroll(function(e) {UserList._onScroll(e);}); $userList.after($('<div class="loading" style="height: 200px; visibility: hidden;"></div>')); |