mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 08:41:46 -05:00
26 lines
742 B
CoffeeScript
26 lines
742 B
CoffeeScript
|
ModalView = require 'views/core/ModalView'
|
||
|
template = require 'templates/courses/classroom-settings-modal'
|
||
|
|
||
|
module.exports = class AddLevelSystemModal extends ModalView
|
||
|
id: 'classroom-settings-modal'
|
||
|
template: template
|
||
|
|
||
|
events:
|
||
|
'click #save-settings-btn': 'onClickSaveSettingsButton'
|
||
|
|
||
|
initialize: (options) ->
|
||
|
@classroom = options.classroom
|
||
|
|
||
|
onClickSaveSettingsButton: ->
|
||
|
return unless @classroom
|
||
|
if name = $('.settings-name-input').val()
|
||
|
@classroom.set('name', name)
|
||
|
description = $('.settings-description-input').val()
|
||
|
@classroom.set('description', description)
|
||
|
@classroom.set('aceConfig', {
|
||
|
language: @$('#programming-language-select').val()
|
||
|
})
|
||
|
@classroom.patch()
|
||
|
@hide()
|
||
|
|
||
|
|