diff options
author | hackademix | 2018-09-05 15:43:55 +0200 |
---|---|---|
committer | hackademix | 2018-09-05 15:43:55 +0200 |
commit | ce5d46ead25289ba5ad9d4725283be26988f4ebf (patch) | |
tree | b55307ac77d42f9b26a23d05c0716e748164ee10 /src/ui | |
parent | 6ffe07f8f6453d201005fae0a28299cb7ddec15b (diff) | |
download | noscript-ce5d46ead25289ba5ad9d4725283be26988f4ebf.tar.gz noscript-ce5d46ead25289ba5ad9d4725283be26988f4ebf.tar.xz noscript-ce5d46ead25289ba5ad9d4725283be26988f4ebf.zip |
Init the CUSTOM preset not just with the capabilities, but also with the "temporary" status of the previously selected one.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/ui.js b/src/ui/ui.js index 8cf20ce..49d5dc1 100644 --- a/src/ui/ui.js +++ b/src/ui/ui.js @@ -98,7 +98,7 @@ var UI = (() => { let url = `/ui/siteInfo.html#${encodeURIComponent(domain)};${UI.tabId}`; browser.tabs.create({url}); }, - + wireOption(name, storage = "sync", onchange) { let input = document.querySelector(`#opt-${name}`); if (!input) { @@ -120,9 +120,9 @@ var UI = (() => { } } return input; - } + } }; - + var HighContrast = { css: null, async init() { @@ -148,7 +148,7 @@ var UI = (() => { this.widget.checked = hc; } }, - + detect() { if ("highContrast" in UI.local) { UI.highContrast = UI.local.highContrast; @@ -425,7 +425,8 @@ var UI = (() => { if (isTemp) { row.perms.temp = target.checked; } else { - let temp = preset.parentNode.querySelector("input.temp").checked; + let temp = row.perms.temp; + tempToggle.checked = temp; let perms = row._customPerms || (row._customPerms = new Permissions(new Set(row.perms.capabilities), temp)); row.perms = perms; |