diff --git a/js/View/ItemView.js b/js/View/ItemView.js index 0ba7da5..a8a751a 100644 --- a/js/View/ItemView.js +++ b/js/View/ItemView.js @@ -120,6 +120,13 @@ var ItemView = Backbone.View.extend({ }, this); }, + replaceItem: function(newItem) { + this.model = newItem; + + this.model.on('change', this.modelToView, this); + this.modelToView(); + }, + renderItem: function() { this.model.on('change', this.modelToView, this); diff --git a/js/View/SimulationView.js b/js/View/SimulationView.js index 736b134..8b5051a 100644 --- a/js/View/SimulationView.js +++ b/js/View/SimulationView.js @@ -248,11 +248,31 @@ var SimulationView = Backbone.View.extend({ var $currentItem = $('
'), $newItem = $('
'), + $copy = $('