partkeepr

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

commit 098acfe00d09246648ad61bca7b9dd389ccb3de3
parent d138c8de73714d188d06c4ccc5aef86c2e95fce4
Author: Felicia Hummel <felicitus@felicitus.org>
Date:   Fri, 19 Aug 2016 14:36:47 +0200

Implemented missing close handler

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/SystemPreferences/Panel.js @@ -64,7 +64,13 @@ Ext.define('PartKeepr.Components.SystemPreferences.Panel', { var config = { title: targetClass.title, closable: targetClass.closable, - iconCls: targetClass.iconCls + iconCls: targetClass.iconCls, + listeners: { + editorClose: function (cmp) { + this.closeEditor(cmp); + }, + scope: this + } }; for (var i = 0; i < this.cards.items.length; i++) { @@ -79,6 +85,15 @@ Ext.define('PartKeepr.Components.SystemPreferences.Panel', { this.cards.setActiveItem(j); }, + closeEditor: function (cmp) { + this.cards.setActiveItem(this.cards.items.getAt(0)); + + for (var i = 0; i < this.cards.items.length; i++) { + if (this.cards.items.getAt(i).$className === cmp.$className) { + this.cards.remove(cmp); + } + } + }, statics: { iconCls: 'fugue-icon gear', title: i18n('System Preferences'),