commit/galaxy-central: jeremy goecks: Config.js: make copy of model to avoid by reference errors. Remove debug statements.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/6f0f77a940fc/ Changeset: 6f0f77a940fc User: jeremy goecks Date: 2014-03-15 18:26:03 Summary: Config.js: make copy of model to avoid by reference errors. Remove debug statements. Affected #: 2 files diff -r 9fd3b0fc3a70b40d8f35e72c4ef2513fdb03a852 -r 6f0f77a940fc4966ce5534a06866ae57899dd867 static/scripts/utils/config.js --- a/static/scripts/utils/config.js +++ b/static/scripts/utils/config.js @@ -128,13 +128,10 @@ * and a saved_values dictionary. */ from_models_and_saved_values: function(models, saved_values) { - // Update models with saved values. + // If there are saved values, copy models and update with saved values. if (saved_values) { - _.each(models, function(m) { - if (saved_values[m.key]) { - // Found saved value, so update model. - m.value = saved_values[m.key]; - } + models = _.map(models, function(m) { + return _.extend({}, m, { value: saved_values[m.key] }); }); } diff -r 9fd3b0fc3a70b40d8f35e72c4ef2513fdb03a852 -r 6f0f77a940fc4966ce5534a06866ae57899dd867 static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -208,7 +208,6 @@ // -- Set up drawable configuration. -- this.config = config_mod.ConfigSettingCollection.from_models_and_saved_values(this.config_params, obj_dict.prefs); - this.config.each(function(s) { console.log(s.id, s.get('value')) }) // If there's no saved name, use object name. if (!this.config.get_value('name')) { @@ -2688,7 +2687,6 @@ * Use from_dict to recreate object. */ to_dict: function() { - console.log(this.config.to_key_value_dict()); return { track_type: this.get_type(), dataset: { Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org