implement updating the filters

This commit is contained in:
Damien Churchill 2009-03-20 09:22:57 +00:00
parent 846d8a0c8f
commit a08a4a4e69
1 changed files with 9 additions and 2 deletions

View File

@ -357,11 +357,18 @@ Deluge.SideBar = {
update: function(filters) { update: function(filters) {
$each(filters, function(states, filter) { $each(filters, function(states, filter) {
if (this.panels.has(filter)) { if (this.panels.has(filter)) {
this.updateFilter(filter, states);
} else { } else {
this.createFilter(filter, states); this.createFilter(filter, states);
} }
}, this); }, this);
// Perform a cleanup of fitlers that aren't enabled
$each(this.panels.getKeys(), function(filter) {
if (!fitlers.has(filter)) {
// We need to remove the panel
}
});
}, },
createFilter: function(filter, states) { createFilter: function(filter, states) {
@ -405,7 +412,7 @@ Deluge.SideBar = {
}, },
updateFilter: function(filter, states) { updateFilter: function(filter, states) {
this.panels[filter].store.loadData(states);
} }
}; };