codecombat/app/views/game-menu/SaveLoadView.coffee

26 lines
695 B
CoffeeScript
Raw Normal View History

CocoView = require 'views/core/CocoView'
template = require 'templates/game-menu/save-load-view'
{me} = require 'core/auth'
ThangType = require 'models/ThangType'
module.exports = class SaveLoadView extends CocoView
id: 'save-load-view'
className: 'tab-pane'
template: template
2014-08-08 18:56:53 -04:00
events:
'change #save-granularity-toggle input': 'onSaveGranularityChanged'
getRenderData: (context={}) ->
context = super(context)
context
afterRender: ->
super()
2014-08-08 18:56:53 -04:00
onSaveGranularityChanged: (e) ->
@playSound 'menu-button-click'
2014-08-08 18:56:53 -04:00
toShow = $(e.target).val()
@$el.find('.save-list, .save-pane').hide()
@$el.find('.save-list.' + toShow + ', .save-pane.' + toShow).show()