Skip to content

Commit

Permalink
[MNOE-978]Fix tables jumping bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Seessel committed Mar 27, 2018
1 parent 1d14af9 commit b992b02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Variables initialization
scope.organizations =
search: ''
sortAttr: 'created_at'
sortAttr: 'created_at.desc'
nbItems: 10
page: 1
pageChangedCb: (nbItems, page) ->
Expand Down Expand Up @@ -80,14 +80,15 @@
# Smart table callback
scope.pipe = (tableState) ->
# The order has changed - reset pagination
debugger
scope.organizations.page = 1
scope.organizations.sortAttr = tableState.sort.predicate
if tableState.sort.reverse
scope.organizations.sortAttr += ".desc"
fetchOrganizations(scope.organizations.nbItems, 0, scope.organizations.sortAttr)

# Fetch organisations
fetchOrganizations = (limit, offset, sort = 'created_at') ->
fetchOrganizations = (limit, offset, sort = 'created_at.desc') ->
scope.organizations.loading = true
MnoeCurrentUser.getUser().then( ->
params = if MnoeAdminConfig.isAccountManagerEnabled()
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/mnoe-users-list/mno-users-list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Variables initialization
scope.users =
search: ''
sortAttr: 'created_at'
sortAttr: 'created_at.desc'
nbItems: 10
page: 1
pageChangedCb: (nbItems, page) ->
Expand Down Expand Up @@ -79,7 +79,7 @@
fetchUsers(scope.users.nbItems, 0, scope.users.sortAttr)

# Fetch users
fetchUsers = (limit, offset, sort = 'surname') ->
fetchUsers = (limit, offset, sort = 'created_at.desc') ->
scope.users.loading = true
MnoeCurrentUser.getUser().then( ->
params = if MnoeAdminConfig.isAccountManagerEnabled()
Expand Down

0 comments on commit b992b02

Please sign in to comment.