partkeepr

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

commit 2dc4dc4469aac5013f0b395539c0d3695f8224e6
parent f70dd432002299a787b3c980f2e06657a9a56c7f
Author: Felicia Hummel <felicia@drachenkatze.org>
Date:   Fri, 20 Dec 2019 19:05:19 +0100

Merge pull request #1004 from jophut/PartKeepr-418

Closes #418 - Doubleclick storage location
Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationEditor.js | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/StorageLocation/StorageLocationEditor.js @@ -48,6 +48,8 @@ Ext.define('PartKeepr.StorageLocationEditor', { ] }); + this.gridPanel.on("itemdblclick", this.onDoubleClick, this); + var container = Ext.create("Ext.form.FieldContainer", { fieldLabel: i18n("Contained Parts"), labelWidth: 110, @@ -129,5 +131,27 @@ Ext.define('PartKeepr.StorageLocationEditor', { this.down('#image').setValue(this.record.getImage()); + }, + onDoubleClick: function(view, record) { + if (record) { + this.onEditPart(record); + } + }, + onEditPart: function(part) { + var editorWindow; + + if (part.get("metaPart") === true) + { + editorWindow = Ext.create("PartKeepr.Components.Part.Editor.MetaPartEditorWindow"); + } else + { + editorWindow = Ext.create("PartKeepr.PartEditorWindow"); + } + editorWindow.on("partSaved", this.onPartSaved, this); + editorWindow.editor.editItem(part); + editorWindow.show(); + }, + onPartSaved: function() { + this.grid.getStore().reload(); } });