Module: deluge Branch: master Commit: 3a12a50f3ec37893ba66b6c8727fdc288afedae9
Author: Damien Churchill <[email protected]> Date: Sun Apr 25 16:04:02 2010 +0100 allow custom templates to be specified for filters --- deluge/ui/web/js/deluge-all/FilterPanel.js | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/FilterPanel.js b/deluge/ui/web/js/deluge-all/FilterPanel.js index 8e1d06b..dd74223 100644 --- a/deluge/ui/web/js/deluge-all/FilterPanel.js +++ b/deluge/ui/web/js/deluge-all/FilterPanel.js @@ -52,8 +52,8 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, { }); this.setTitle(_(title)); - if (this.filterType == 'tracker_host') { - var tpl = '<div class="x-deluge-filter" style="background-image: url(' + deluge.config.base + 'tracker/{filter});">{filter} ({count})</div>'; + if (Deluge.FilterPanel.templates[this.filterType]) { + var tpl = Deluge.FilterPanel.templates[this.filterType]; } else { var tpl = '<div class="x-deluge-filter x-deluge-{filter:lowercase}">{filter} ({count})</div>'; } @@ -103,3 +103,7 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, { return this.list.getStore(); } }); + +Deluge.FilterPanel.templates = { + 'tracker_host': '<div class="x-deluge-filter" style="background-image: url(' + deluge.config.base + 'tracker/{filter});">{filter} ({count})</div>' +} -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
