mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Fixed pasting component configs into the thang component config treema.
This commit is contained in:
parent
ac2c39a266
commit
7bdfcb4313
3 changed files with 8 additions and 3 deletions
app/views/editor
component
level/scripts
|
@ -29,6 +29,11 @@ module.exports = class ThangComponentConfigView extends CocoView
|
|||
afterRender: ->
|
||||
super()
|
||||
@buildTreema()
|
||||
|
||||
setConfig: (config) ->
|
||||
@handlingChange = true
|
||||
@editThangTreema.set('/', config)
|
||||
@handlingChange = false
|
||||
|
||||
setIsDefaultComponent: (isDefaultComponent) ->
|
||||
changed = @isDefaultComponent isnt isDefaultComponent
|
||||
|
@ -80,6 +85,7 @@ module.exports = class ThangComponentConfigView extends CocoView
|
|||
@$el.find('.panel-body').hide()
|
||||
|
||||
onConfigEdited: =>
|
||||
return if @handlingChange
|
||||
@config = @editThangTreema.data
|
||||
@changed = true
|
||||
@trigger 'changed', { component: @component, config: @data() }
|
||||
|
|
|
@ -108,8 +108,7 @@ module.exports = class ThangComponentsEditView extends CocoView
|
|||
|
||||
if @components.length < @lastComponentLength
|
||||
@onComponentsRemoved()
|
||||
else
|
||||
@onComponentsAdded()
|
||||
@onComponentsAdded()
|
||||
|
||||
onComponentsRemoved: ->
|
||||
componentMap = {}
|
||||
|
|
|
@ -88,7 +88,7 @@ module.exports = class ScriptsTabView extends CocoView
|
|||
@selectedScriptPath = newPath
|
||||
|
||||
getThangIDs: ->
|
||||
(t.id for t in @level.get('thangs') when t.id isnt 'Interface')
|
||||
(t.id for t in @level.get('thangs') ? [] when t.id isnt 'Interface')
|
||||
|
||||
onNewScriptAdded: (scriptNode) =>
|
||||
return unless scriptNode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue