codecombat/app/views/play/menu/SaveLoadView.coffee
Imperadeiro98 8e8a3103d5 Refactor to use view in template for issue #3138
This removes getRenderData from: CareersView, SaveCampaignModal,
InfiniteLoopModal, SpellListEntryThangsView, SaveLoadView,
PlaySettingsModal and JobProfileCodeModal.
2015-11-09 21:29:27 +00:00

21 lines
620 B
CoffeeScript

CocoView = require 'views/core/CocoView'
template = require 'templates/play/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
events:
'change #save-granularity-toggle input': 'onSaveGranularityChanged'
afterRender: ->
super()
onSaveGranularityChanged: (e) ->
@playSound 'menu-button-click'
toShow = $(e.target).val()
@$el.find('.save-list, .save-pane').hide()
@$el.find('.save-list.' + toShow + ', .save-pane.' + toShow).show()