mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-18 09:28:52 +01:00
parent
c6e4027a7f
commit
2c1756ff07
@ -102,6 +102,7 @@
|
|||||||
|
|
||||||
const table = document.createElement("table");
|
const table = document.createElement("table");
|
||||||
whitelistSettings.forEach(function(setting){
|
whitelistSettings.forEach(function(setting){
|
||||||
|
const settingDefinition = settings.getDefinition(setting.name);
|
||||||
const row = document.createElement("tr");
|
const row = document.createElement("tr");
|
||||||
setting.row = row;
|
setting.row = row;
|
||||||
const name = document.createElement("td");
|
const name = document.createElement("td");
|
||||||
@ -110,11 +111,13 @@
|
|||||||
setting.input = document.createElement("input");
|
setting.input = document.createElement("input");
|
||||||
setting.input.type = "checkbox";
|
setting.input.type = "checkbox";
|
||||||
setting.input.addEventListener("change", function(){
|
setting.input.addEventListener("change", function(){
|
||||||
settings.set(
|
const value = this.checked? setting.protectedValue: setting.whitelistValue;
|
||||||
setting.name,
|
if (settingDefinition.get() === value){
|
||||||
this.checked? setting.protectedValue: setting.whitelistValue,
|
settingDefinition.reset(setSelect.value);
|
||||||
setSelect.value
|
}
|
||||||
);
|
else {
|
||||||
|
settingDefinition.set(value, setSelect.value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const input = document.createElement("td");
|
const input = document.createElement("td");
|
||||||
input.appendChild(setting.input);
|
input.appendChild(setting.input);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user