From e7f221813e247b28df3e6da48341d4e42f042c1e Mon Sep 17 00:00:00 2001 From: duybkict Date: Fri, 3 Jun 2016 09:23:35 +0700 Subject: [PATCH] remove constructor, handle load async process --- app/views/ladder/LadderView.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/ladder/LadderView.coffee b/app/views/ladder/LadderView.coffee index 5a2e5d69b..28076bc4a 100644 --- a/app/views/ladder/LadderView.coffee +++ b/app/views/ladder/LadderView.coffee @@ -39,12 +39,10 @@ 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 - @levelDescription = marked(@level.get('description')) if @level.get('description') + @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]