Skip to content

Commit

Permalink
fix save as copy (Closes #1840)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman authored and rijkvanzanten committed Oct 31, 2017
1 parent bbc4c74 commit 7792e0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/modules/tables/views/EditView.js
Expand Up @@ -175,11 +175,14 @@ define([
}
};
}

if (action === 'save-form-copy') {
// console.log('cloning...');
var clone = model.toJSON();
delete clone.id;
model = new collection.model(clone, {collection: collection, parse: true});
model = new collection.model({}, {collection: collection, parse: true});
// Start tracking changes to mark the new values
model.startTracking();
model.set(clone);
collection.add(model);
}

Expand Down

0 comments on commit 7792e0b

Please sign in to comment.