From fec735f948da2553bc22191f359baf17e6f1817a Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 28 Apr 2010 08:42:29 +0100 Subject: [PATCH] fix the first item being selected upon creation --- deluge/ui/web/js/deluge-all/FilterPanel.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/FilterPanel.js b/deluge/ui/web/js/deluge-all/FilterPanel.js index a68617055..80294404c 100644 --- a/deluge/ui/web/js/deluge-all/FilterPanel.js +++ b/deluge/ui/web/js/deluge-all/FilterPanel.js @@ -77,12 +77,6 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, { }] }); this.relayEvents(this.list, ['selectionchange']); - this.list.afterMethod('bindStore', this.doBindStore, this); - }, - - // private - doBindStore: function() { - this.list.select(0); }, /** @@ -160,6 +154,10 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, { }, this); store.commitChanges(); + + if (!this.list.getSelectionCount()) { + this.list.select(0); + } }, });