concord-consortium/lab — pull request #60 by pjanik (2014-01-08 13:46:11+00:00)
Title: Properties that are bound to widgets are automatically retained

When a property is bound to some widget and this widget has option *retainProperty* equal to true (which is default), this property will be retained during model reload / reset.

*widgets-retained-props* branch is deployed to http://lab4.dev.concord.org/ at the moment, so e.g. you can open:
http://lab4.dev.concord.org/interactives.html#interactives/samples/3-100-atoms.json
and change model properties using checkbox and sliders. Then reload the model. You should notice that model properties that are bound to widgets are retained during reload (note that it also causes that widgets state don't change during reload).

If you try to do the same here:
http://lab.dev.concord.org/interactives.html#interactives/samples/3-100-atoms.json
(lab.dev, old behavior)
you will notice that the same properties are restored to their initial values.

In this pull request I also updated a couple of interactives to work better with this new pattern (quite often it was enough to change action scripts to property binding or modify slightly "onLoad" scripts). In some interactives (e.g. "Pendulum") it was no longer necessary to manually provide list of parameters to retain during model reload.