remove constructor, handle load async process

This commit is contained in:
duybkict 2016-06-03 09:23:35 +07:00
parent b88ca10f21
commit e7f221813e

View file

@ -39,11 +39,9 @@ module.exports = class LadderView extends RootView
'click a:not([data-toggle])': 'onClickedLink'
'click .spectate-button': 'onClickSpectateButton'
constructor: (options, @levelID, @leagueType, @leagueID) ->
super(options)
initialize: ->
initialize: (options, @levelID, @leagueType, @leagueID) ->
@level = @supermodel.loadModel(new Level(_id: @levelID)).model
@level.once 'sync', =>
@levelDescription = marked(@level.get('description')) if @level.get('description')
@sessions = @supermodel.loadCollection(new LevelSessionsCollection(@levelID), 'your_sessions', {cache: false}).model
@winners = require('./tournament_results')[@levelID]