diff --git a/app/assets/javascripts/router.js.coffee b/app/assets/javascripts/router.js.coffee index 51e35ab67..6c371b85c 100644 --- a/app/assets/javascripts/router.js.coffee +++ b/app/assets/javascripts/router.js.coffee @@ -42,7 +42,6 @@ class BonnieRouter extends Backbone.Router @calculator.cancelCalculations() @users = new Thorax.Collections.Users() usersView = new Thorax.Views.Users(collection: @users) - @users.fetch(success: => usersView.render()) @mainView.setView(usersView) renderPatientBuilder: (measureHqmfSetId, patientId) -> diff --git a/app/assets/javascripts/views/users_view.js.coffee b/app/assets/javascripts/views/users_view.js.coffee index b43d0531f..0b1d7711b 100644 --- a/app/assets/javascripts/views/users_view.js.coffee +++ b/app/assets/javascripts/views/users_view.js.coffee @@ -19,6 +19,7 @@ class Thorax.Views.Users extends Thorax.Views.BonnieView @activePatientsCount = @activeUsers.reduce(((sum, user) -> sum + user.get('patient_count')), 0) @activePatientsMax = _.max(@activeUsers.pluck('patient_count')) @topTenPatientCounts = _((new Thorax.Collection(@collection.models, comparator: (u) -> parseInt(u.get('patient_count')) * -1 )).sort().pluck('patient_count')).first(10) + @render() sortUsers: (e) -> attr = $(e.target).val()