From 6b7302ed4bde8c4dd1173dddb9d1628119295ce0 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 21 Mar 2009 11:49:43 +0000 Subject: [PATCH] fix clearing the sidebar so filters can be re-added after a reconnect --- deluge/ui/web/js/deluge-bars.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deluge/ui/web/js/deluge-bars.js b/deluge/ui/web/js/deluge-bars.js index 374858039..1029593d4 100644 --- a/deluge/ui/web/js/deluge-bars.js +++ b/deluge/ui/web/js/deluge-bars.js @@ -338,10 +338,11 @@ Deluge.SideBar = { }, onDisconnect: function() { - this.Bar.items.each(function(panel) { - panel.destroy(); - }); + this.panels.getKeys().each(function(el) { + this.Bar.remove(el + '-panel'); + }, this); this.panels.empty(); + this.selected = null; }, renderer: function(value, p, r) { @@ -411,6 +412,7 @@ Deluge.SideBar = { }); var panel = new Ext.grid.GridPanel({ + id: filter + '-panel', store: store, title: title, cls: 'x-deluge-filters', @@ -432,7 +434,9 @@ Deluge.SideBar = { }); store.loadData(states); this.Bar.add(panel); + this.Bar.doLayout(); + this.panels[filter] = panel; if (!this.selected) { panel.getSelectionModel().selectFirstRow(); @@ -442,8 +446,6 @@ Deluge.SideBar = { panel: panel } } - - this.panels[filter] = panel; }, onSelect: function(selModel, rowIndex, record) {