codecombat / treema

jQuery plugin that generates HTML interfaces to edit JSON data defined by json-schema.
http://codecombat.github.io/treema/
MIT License
152 stars 36 forks source link

Change callbacks don't always fire when adding a new child to a collection #42

Closed nwinter closed 10 years ago

nwinter commented 10 years ago

This is in 0.0.14. When I go from this:

screenshot 2014-08-25 14 33 44

... to this by adding the lol2 propert:

screenshot 2014-08-25 14 33 53

... no change callback is fired. If I edit the nested properties of lol2, it then says it's changed. I think it's the child add event that isn't triggering change.

sderickson commented 10 years ago

This was not a treema issue. The configSchema treemas were being passed in the raw data from the models, editing that raw data directly, and so messing up the model's internal attributes, breaking their revert system. Fixed in this commit: https://github.com/codecombat/codecombat/commit/3fd9cb89ef5cfdcc03364ce223ed644b8fd31229