partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit e07cc402e544bf323140114d856cf9811d805298
parent f3c64c7d57512ffb9e0a762caec64566c19f3795
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon, 21 Sep 2015 16:49:53 +0200

Fixed part duplication function

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/Part/PartsManager.js | 11++++++++---
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'