Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 8616118: Fixed: Options display doesn`t adapt correctly when a custom filter group is added/removed (Closed)
Patch Set: Created Oct. 22, 2012, 8:47 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -352,26 +352,33 @@ function onFilterChange(action, item, pa
case "subscription.homepage":
case "subscription.lastDownload":
case "subscription.downloadStatus":
var element = findSubscriptionElement(item);
if (element)
updateSubscriptionInfo(element);
break;
case "subscription.added":
- if (!(item instanceof SpecialSubscription) && !findSubscriptionElement(item))
+ if (item instanceof SpecialSubscription)
{
- if (item.url == Prefs.subscriptions_exceptionsurl)
- $("#acceptableAds").prop("checked", true);
- else
- addSubscriptionEntry(item);
+ for (var i = 0; i < item.filters.length; i++)
+ onFilterChange("filter.added", item.filters[i]);
}
+ else if (item.url == Prefs.subscriptions_exceptionsurl)
+ $("#acceptableAds").prop("checked", true);
+ else if (!findSubscriptionElement(item))
+ addSubscriptionEntry(item);
break;
case "subscription.removed":
- if (item.url == Prefs.subscriptions_exceptionsurl)
+ if (item instanceof SpecialSubscription)
+ {
+ for (var i = 0; i < item.filters.length; i++)
+ onFilterChange("filter.removed", item.filters[i]);
+ }
+ else if (item.url == Prefs.subscriptions_exceptionsurl)
$("#acceptableAds").prop("checked", false);
else
{
var element = findSubscriptionElement(item);
if (element)
element.parentNode.removeChild(element);
}
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld