Fixed pasting component configs into the thang component config treema.

This commit is contained in:
Scott Erickson 2014-08-27 17:29:28 -07:00
parent ac2c39a266
commit 7bdfcb4313
3 changed files with 8 additions and 3 deletions

View file

@ -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() }

View file

@ -108,8 +108,7 @@ module.exports = class ThangComponentsEditView extends CocoView
if @components.length < @lastComponentLength
@onComponentsRemoved()
else
@onComponentsAdded()
@onComponentsAdded()
onComponentsRemoved: ->
componentMap = {}

View file

@ -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