Removed some unnecessary callbacks.

This commit is contained in:
Scott Erickson 2014-03-26 11:48:40 -07:00
parent aec4669780
commit 3b8cba291d

View file

@ -141,16 +141,13 @@ class LeaderboardData
@topPlayers = new LeaderboardCollection(@level, {order:-1, scoreOffset: HIGHEST_SCORE, team: @team, limit: 20}) @topPlayers = new LeaderboardCollection(@level, {order:-1, scoreOffset: HIGHEST_SCORE, team: @team, limit: 20})
promises = [] promises = []
promises.push @topPlayers.fetch() promises.push @topPlayers.fetch()
@topPlayers.once 'sync', @onceLeaderboardPartLoaded, @
if @session if @session
score = @session.get('totalScore') or 10 score = @session.get('totalScore') or 10
@playersAbove = new LeaderboardCollection(@level, {order:1, scoreOffset: score, limit: 4, team: @team}) @playersAbove = new LeaderboardCollection(@level, {order:1, scoreOffset: score, limit: 4, team: @team})
promises.push @playersAbove.fetch() promises.push @playersAbove.fetch()
@playersAbove.once 'sync', @onceLeaderboardPartLoaded, @
@playersBelow = new LeaderboardCollection(@level, {order:-1, scoreOffset: score, limit: 4, team: @team}) @playersBelow = new LeaderboardCollection(@level, {order:-1, scoreOffset: score, limit: 4, team: @team})
promises.push @playersBelow.fetch() promises.push @playersBelow.fetch()
@playersBelow.once 'sync', @onceLeaderboardPartLoaded, @
level = "#{level.get('original')}.#{level.get('version').major}" level = "#{level.get('original')}.#{level.get('version').major}"
success = (@myRank) => success = (@myRank) =>
promises.push $.ajax "/db/level/#{level}/leaderboard_rank?scoreOffset=#{@session.get('totalScore')}&team=#{@team}", {success} promises.push $.ajax "/db/level/#{level}/leaderboard_rank?scoreOffset=#{@session.get('totalScore')}&team=#{@team}", {success}