Commit db83fed2 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Keep selection when toggling between two user lists.

When switching from "users by vote" to "users by comments"
select the previously selected user.
parent bbbf9193
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -117,10 +117,16 @@ Ext.define('Docs.view.comments.Users', {
            params: {
                sortBy: sortBy
            },
            success: function(users) {
                this.usersList.getStore().loadData(users);
            },
            success: this.loadUsers,
            scope: this
        });
    },

    loadUsers: function(users) {
        this.usersList.getStore().loadData(users);
        if (this.selectedUser) {
            var index = this.usersList.getStore().findExact("username", this.selectedUser.get("username"));
            this.usersList.getSelectionModel().select(index, false, true);
        }
    }
});