Fix asset save.

This commit is contained in:
Marton Somogyi
2013-03-02 13:31:46 +01:00
parent cf7ea925f5
commit b14db571b0
2 changed files with 2 additions and 2 deletions

View File

@@ -141,7 +141,7 @@ class EditAssetView extends Backbone.View
@collection.add @model if not @model.collection
(@$el.children ":first").modal 'hide'
_.extend @model.attributes, data
@model.collection.add @model if isNew
@model.collection.add @model unless @edit
save.fail =>
(@$ '.progress').hide()
(@$ 'input, select').prop 'disabled', off

View File

@@ -329,7 +329,7 @@
}
(_this.$el.children(":first")).modal('hide');
_.extend(_this.model.attributes, data);
if (isNew) {
if (!_this.edit) {
return _this.model.collection.add(_this.model);
}
});