Clone the attributes object

So that modifications don't affect the model
This commit is contained in:
David Baumgold
2013-05-09 13:50:07 -04:00
parent 355162c7f6
commit cd2f67afa4

View File

@@ -6,7 +6,7 @@ CMS.Views.SystemFeedback = Backbone.View.extend({
},
template: _.template($("#system-feedback-tpl").text()),
render: function() {
var attrs = this.model.attributes;
var attrs = $.extend({}, this.model.attributes);
if(attrs.type) {
attrs.modelType = attrs.type;
delete attrs.type;