partkeepr

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

commit 0bb0de5d36071cdfd50222ba50893aa5f3d05bfc
parent 8f14622d6371634f7d0537f3a156f876ae96c9ff
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 30 Jun 2011 17:35:07 +0200

Moved the filter panel to a nested border layout to avoid issue #74

Diffstat:
Mfrontend/js/Components/Part/PartFilterPanel.js | 1-
Mfrontend/js/Components/Part/PartsGrid.js | 35-----------------------------------
Mfrontend/js/Components/Part/PartsManager.js | 20+++++++++++++++++++-
3 files changed, 19 insertions(+), 37 deletions(-)

diff --git a/frontend/js/Components/Part/PartFilterPanel.js b/frontend/js/Components/Part/PartFilterPanel.js @@ -55,7 +55,6 @@ Ext.define('PartKeepr.PartFilterPanel', { xtype: 'toolbar', enableOverflow: true, dock: 'bottom', - ui: 'footer', items: [ this.applyButton, this.resetButton ] }]; diff --git a/frontend/js/Components/Part/PartsGrid.js b/frontend/js/Components/Part/PartsGrid.js @@ -36,25 +36,6 @@ Ext.define('PartKeepr.PartsGrid', { // Initialize the panel this.callParent(); - // Create the filter panel - this.filterPanel = Ext.create("PartKeepr.PartFilterPanel", { - dock: 'bottom', - title: i18n("Filter"), - height: 200, - store: this.store - }); - - this.filterButton = Ext.create("Ext.button.Button", { - enableToggle: true, - text: i18n("Filter"), - handler: this.onFilterClick, - scope: this - }); - - - - // Add the filter button - this.bottomToolbar.add([ '-', this.filterButton ]); }, /** * Defines the columns used in this grid. @@ -102,22 +83,6 @@ Ext.define('PartKeepr.PartsGrid', { } }, /** - * Shows or hides the filter panel. - * - * Unfortunately, we can't simply use show() or hide() on filterPanel, so we add and remove the panel. - */ - onFilterClick: function () { - if (this.filterButton.pressed) { - if (!this.getDockedComponent(this.filterPanel)) { - this.addDocked(this.filterPanel); - } - } else { - if (this.getDockedComponent(this.filterPanel)) { - this.removeDocked(this.filterPanel, false); - } - } - }, - /** * Sets the category. Triggers a store reload with a category filter. */ setCategory: function (category) { diff --git a/frontend/js/Components/Part/PartsManager.js b/frontend/js/Components/Part/PartsManager.js @@ -8,6 +8,7 @@ Ext.define('PartKeepr.PartManager', { extend: 'Ext.panel.Panel', alias: 'widget.PartManager', layout: 'border', + border: false, initComponent: function () { /** @@ -28,6 +29,7 @@ Ext.define('PartKeepr.PartManager', { categoryModel: 'PartKeepr.PartCategory', categoryService: 'PartCategory', split: true, + title: i18n("Categories"), ddGroup: 'CategoryTree', width: 300, // @todo Make this configurable collapsible: true // We want to collapse the tree panel on small screens @@ -67,7 +69,23 @@ Ext.define('PartKeepr.PartManager', { items: [ this.detail, this.stockLevel ] }); - this.items = [ this.tree, this.grid, this.detailPanel ]; + this.filterPanel = Ext.create("PartKeepr.PartFilterPanel", { + region: 'south', + title: i18n("Filter"), + height: 200, + split: true, + collapsed: true, + collapsible: true, + store: this.store + }); + + this.items = [ this.tree, { + layout: 'border', + border: false, + region: 'center', + items: [ this.grid, this.filterPanel ] + }, this.detailPanel ]; + this.callParent(); },