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

Unified Diff: options.js

Issue 29339287: Issue 3885 - Disable the checkbox to toggle the Acceptable Ads list on the options page (Closed)
Patch Set: Created April 1, 2016, 3:40 p.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
@@ -178,7 +178,12 @@
element.setAttribute("data-search", title.toLowerCase());
var control = element.querySelector(".control[role='checkbox']");
if (control)
+ {
control.setAttribute("aria-checked", item.disabled == false);
+ if (item.disableable == false &&
+ this.details[i].onClick == toggleDisableSubscription)
+ control.setAttribute("disabled", true);
+ }
var downloadStatus = item.downloadStatus;
var dateElement = element.querySelector(".date");
@@ -453,7 +458,10 @@
collection = collections.allLangs;
}
else if (subscriptionUrl == acceptableAdsUrl)
+ {
collection = collections.acceptableAds;
+ subscription.disableable = false;
+ }
else
collection = collections.custom;
@@ -897,14 +905,7 @@
function getAcceptableAdsURL(callback)
{
- getPref("subscriptions_exceptionsurl", function(value)
- {
- getAcceptableAdsURL = function(callback)
- {
- callback(value);
- };
- getAcceptableAdsURL(callback);
- });
+ getPref("subscriptions_exceptionsurl", callback);
Sebastian Noack 2016/04/01 15:41:56 Unrelated, but I couldn't resits. WTF?
Sebastian Noack 2016/04/06 17:15:41 Ahh, now I understand. The old code impelemted som
Thomas Greiner 2016/04/07 17:21:15 Yeah, the idea here was to avoid messaging the bac
Sebastian Noack 2016/04/08 14:22:16 Well, a promise still requires a callback. Caching
}
function addEnableSubscription(url, title, homepage)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld