mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Make components read only for anonymous users
This commit is contained in:
parent
3165a2b654
commit
0a8ec096f7
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
supermodel: @supermodel
|
||||
schema: schema
|
||||
data: data
|
||||
readonly: @me.get('anonymous')
|
||||
callbacks: {change: @onComponentSettingsEdited}
|
||||
@componentSettingsTreema = @$el.find('#edit-component-treema').treema treemaOptions
|
||||
@componentSettingsTreema.build()
|
||||
|
@ -67,6 +68,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
supermodel: @supermodel
|
||||
schema: LevelComponent.schema.properties.configSchema
|
||||
data: @levelComponent.get 'configSchema'
|
||||
readonly: @me.get('anonymous')
|
||||
callbacks: {change: @onConfigSchemaEdited}
|
||||
@configSchemaTreema = @$el.find('#config-schema-treema').treema treemaOptions
|
||||
@configSchemaTreema.build()
|
||||
|
@ -83,6 +85,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
editorEl = $('<div></div>').text(@levelComponent.get('code')).addClass('inner-editor')
|
||||
@$el.find('#component-code-editor').empty().append(editorEl)
|
||||
@editor = ace.edit(editorEl[0])
|
||||
@editor.setReadOnly(me.get('anonymous'))
|
||||
session = @editor.getSession()
|
||||
session.setMode 'ace/mode/coffee'
|
||||
session.setTabSize 2
|
||||
|
|
Loading…
Reference in a new issue