From 3b1d038d2d0db94c976691ee34d1f6e816f7f516 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Mon, 26 Apr 2010 01:33:15 +0100 Subject: [PATCH] add missing getFilter function and improve hasFilter --- deluge/ui/web/js/deluge-all/Sidebar.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/Sidebar.js b/deluge/ui/web/js/deluge-all/Sidebar.js index 53b4cc9ed..e194a3d8c 100644 --- a/deluge/ui/web/js/deluge-all/Sidebar.js +++ b/deluge/ui/web/js/deluge-all/Sidebar.js @@ -87,6 +87,10 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, { this.fireEvent('afterfiltercreate', this, panel); }, + getFilter: function(filter) { + return this.panels[filter]; + }, + getFilterStates: function() { var states = {} @@ -101,14 +105,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, { }, hasFilter: function(filter) { - var has = false; - this.items.each(function(panel) { - if (panel.filterType == filter) { - has = true; - return false; - } - }); - return has; + return (this.panels[filter]) ? true : false; }, // private