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

Unified Diff: js/desktop-options.js

Issue 29712664: Issue 6432 - Hide remove button for additional filter lists (Closed)
Patch Set: Reverted the colors back Created March 9, 2018, 11:25 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 | « desktop-options.html ('k') | skin/icons/checkbox.svg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: js/desktop-options.js
===================================================================
--- a/js/desktop-options.js
+++ b/js/desktop-options.js
@@ -26,6 +26,7 @@
let acceptableAdsUrl = null;
let acceptableAdsPrivacyUrl = null;
let isCustomFiltersLoaded = false;
+let additionalSubscriptions = [];
let {getMessage} = browser.i18n;
let {setElementText} = ext.i18n;
let customFilters = [];
@@ -237,7 +238,17 @@
{
control.setAttribute("aria-checked", item.disabled == false);
if (isAcceptableAds(item.url) && this == collections.filterLists)
+ {
control.disabled = true;
+ }
+ }
+ if (additionalSubscriptions.includes(item.url))
+ {
+ element.classList.add("preconfigured");
+ let disablePreconfigures =
+ element.querySelectorAll("[data-disable~='preconfigured']");
+ for (let disablePreconfigure of disablePreconfigures)
+ disablePreconfigure.disabled = true;
}
let lastUpdateElement = element.querySelector(".last-update");
@@ -1170,17 +1181,22 @@
{
acceptableAdsPrivacyUrl = urlPrivacy;
- // Load user subscriptions
- browser.runtime.sendMessage({
- type: "subscriptions.get",
- downloadable: true
- },
- (subscriptions) =>
+ getPref("additional_subscriptions", (subscriptionUrls) =>
{
- for (let subscription of subscriptions)
- onSubscriptionMessage("added", subscription);
+ additionalSubscriptions = subscriptionUrls;
- setAcceptableAds();
+ // Load user subscriptions
+ browser.runtime.sendMessage({
+ type: "subscriptions.get",
+ downloadable: true
+ },
+ (subscriptions) =>
+ {
+ for (let subscription of subscriptions)
+ onSubscriptionMessage("added", subscription);
+
+ setAcceptableAds();
+ });
});
});
});
« no previous file with comments | « desktop-options.html ('k') | skin/icons/checkbox.svg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld