mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 18:15:52 -05:00
30 lines
720 B
CoffeeScript
30 lines
720 B
CoffeeScript
|
ModalView = require 'views/kinds/ModalView'
|
||
|
template = require 'templates/modal/terrain_randomise'
|
||
|
CocoModel = require 'models/CocoModel'
|
||
|
|
||
|
module.exports = class TerrainRandomiseModal extends ModalView
|
||
|
id: 'terrain-randomise-modal'
|
||
|
template: template
|
||
|
thangs = []
|
||
|
|
||
|
events:
|
||
|
'click .play-option': 'onRandomise'
|
||
|
|
||
|
onRevertModel: (e) ->
|
||
|
id = $(e.target).val()
|
||
|
CocoModel.backedUp[id].revert()
|
||
|
$(e.target).closest('tr').remove()
|
||
|
@reloadOnClose = true
|
||
|
|
||
|
onRandomise: (e) ->
|
||
|
|
||
|
getRenderData: ->
|
||
|
c = super()
|
||
|
models = _.values CocoModel.backedUp
|
||
|
models = (m for m in models when m.hasLocalChanges())
|
||
|
c.models = models
|
||
|
c
|
||
|
|
||
|
onHidden: ->
|
||
|
location.reload() if @reloadOnClose
|