This commit is contained in:
Nick Winter 2014-02-13 17:35:01 -08:00
commit bf030418dc
2 changed files with 5 additions and 1 deletions

View file

@ -20,7 +20,7 @@ block content
table.table
for session in team.leaderboard.topPlayers.models
tr
td.score-cell= parseInt(session.get('totalScore'))
td.score-cell= session.get('totalScore')
td= session.get('creatorName')
td
a(href="/play/level/#{level.get('slug') || level.id}/?team=#{team.otherTeam}&opponent=#{session.id}") COMPETE

View file

@ -105,6 +105,10 @@ class LeaderboardData
_.extend @, Backbone.Events
@topPlayers = new LeaderboardCollection(@level, {order:-1, scoreOffset: HIGHEST_SCORE, team: @team, limit: if @session then 10 else 20})
@topPlayers.fetch()
@topPlayers.comparator = (model) ->
return -model.get('totalScore')
@topPlayers.sort()
@topPlayers.once 'sync', @leaderboardPartLoaded, @
# if @session