commit e07cc402e544bf323140114d856cf9811d805298
parent f3c64c7d57512ffb9e0a762caec64566c19f3795
Author: Felicitus <felicitus@felicitus.org>
Date: Mon, 21 Sep 2015 16:49:53 +0200
Fixed part duplication function
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js
@@ -263,6 +263,10 @@ Ext.define('PartKeepr.PartManager', {
{
var copy = rec.copy();
+ copy.setCategory(rec.getCategory());
+ copy.setFootprint(rec.getFootprint());
+ copy.setStorageLocation(rec.getStorageLocation());
+
var j = Ext.create("PartKeepr.PartEditorWindow", {
partMode: 'create'
});
@@ -277,10 +281,11 @@ Ext.define('PartKeepr.PartManager', {
*/
createFullPartDuplicate: function (rec)
{
- var data = rec.getData(true);
- data.id = null;
+ var data = rec.getData();
+
newItem = Ext.create("PartKeepr.PartBundle.Entity.Part");
- newItem.setDataWithAssociations(data);
+ newItem.set(data);
+ newItem.setAssociationData(rec.getAssociationData());
var j = Ext.create("PartKeepr.PartEditorWindow", {
partMode: 'create'