mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 18:15:52 -05:00
24 lines
622 B
CoffeeScript
24 lines
622 B
CoffeeScript
CocoView = require 'views/core/CocoView'
|
|
Level = require 'models/Level'
|
|
|
|
module.exports = class CampaignLevelView extends CocoView
|
|
id: 'campaign-level-view'
|
|
template: require 'templates/editor/campaign/campaign-level-view'
|
|
|
|
events:
|
|
'click .close': 'onClickClose'
|
|
|
|
constructor: (options, @level) ->
|
|
super(options)
|
|
@fullLevel = new Level _id: @level.id
|
|
@fullLevel.fetch()
|
|
@listenToOnce @fullLevel, 'sync', => @render?()
|
|
|
|
getRenderData: ->
|
|
c = super()
|
|
c.level = if @fullLevel.loaded then @fullLevel else @level
|
|
c
|
|
|
|
onClickClose: ->
|
|
@$el.addClass('hidden')
|
|
@trigger 'hidden'
|