mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-24 21:13:35 -04:00
Fixes #1220. Passing in the raw attributes to the component settings treema would edit the data before the component's set method would get a snapshot of the original data for whatever was the first change in the data.
This commit is contained in:
parent
0a139fdbb3
commit
b635c4cf16
2 changed files with 2 additions and 1 deletions
app
|
@ -211,7 +211,7 @@ class CocoModel extends Backbone.Model
|
|||
try
|
||||
jsondiffpatch.patch newAttributes, delta
|
||||
catch error
|
||||
console.error 'Error applying delta', delta, 'to attributes', newAttributes, error
|
||||
console.error 'Error applying delta\n', JSON.stringify(delta, null, '\t'), '\n\nto attributes\n\n', newAttributes
|
||||
return false
|
||||
@set newAttributes
|
||||
return true
|
||||
|
|
|
@ -45,6 +45,7 @@ module.exports = class LevelComponentEditView extends View
|
|||
|
||||
buildSettingsTreema: ->
|
||||
data = _.pick @levelComponent.attributes, (value, key) => key in @editableSettings
|
||||
data = $.extend(true, {}, data)
|
||||
schema = _.cloneDeep LevelComponent.schema
|
||||
schema.properties = _.pick schema.properties, (value, key) => key in @editableSettings
|
||||
schema.required = _.intersection schema.required, @editableSettings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue