Init the CUSTOM preset not just with the capabilities, but also with the "temporary" status of the previously selected one.
This commit is contained in:
parent
6ffe07f8f6
commit
ce5d46ead2
11
src/ui/ui.js
11
src/ui/ui.js
|
@ -98,7 +98,7 @@ var UI = (() => {
|
||||||
let url = `/ui/siteInfo.html#${encodeURIComponent(domain)};${UI.tabId}`;
|
let url = `/ui/siteInfo.html#${encodeURIComponent(domain)};${UI.tabId}`;
|
||||||
browser.tabs.create({url});
|
browser.tabs.create({url});
|
||||||
},
|
},
|
||||||
|
|
||||||
wireOption(name, storage = "sync", onchange) {
|
wireOption(name, storage = "sync", onchange) {
|
||||||
let input = document.querySelector(`#opt-${name}`);
|
let input = document.querySelector(`#opt-${name}`);
|
||||||
if (!input) {
|
if (!input) {
|
||||||
|
@ -120,9 +120,9 @@ var UI = (() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var HighContrast = {
|
var HighContrast = {
|
||||||
css: null,
|
css: null,
|
||||||
async init() {
|
async init() {
|
||||||
|
@ -148,7 +148,7 @@ var UI = (() => {
|
||||||
this.widget.checked = hc;
|
this.widget.checked = hc;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
detect() {
|
detect() {
|
||||||
if ("highContrast" in UI.local) {
|
if ("highContrast" in UI.local) {
|
||||||
UI.highContrast = UI.local.highContrast;
|
UI.highContrast = UI.local.highContrast;
|
||||||
|
@ -425,7 +425,8 @@ var UI = (() => {
|
||||||
if (isTemp) {
|
if (isTemp) {
|
||||||
row.perms.temp = target.checked;
|
row.perms.temp = target.checked;
|
||||||
} else {
|
} else {
|
||||||
let temp = preset.parentNode.querySelector("input.temp").checked;
|
let temp = row.perms.temp;
|
||||||
|
tempToggle.checked = temp;
|
||||||
let perms = row._customPerms ||
|
let perms = row._customPerms ||
|
||||||
(row._customPerms = new Permissions(new Set(row.perms.capabilities), temp));
|
(row._customPerms = new Permissions(new Set(row.perms.capabilities), temp));
|
||||||
row.perms = perms;
|
row.perms = perms;
|
||||||
|
|
Loading…
Reference in New Issue