You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
802 B
36 lines
802 B
const Store = require('electron-store');
|
|
const store = new Store();
|
|
|
|
const $ = require("../javascripts/jquery.min.js");
|
|
|
|
const settings = [
|
|
"minimize",
|
|
"startup",
|
|
"startup-min"
|
|
]
|
|
|
|
settings.forEach(setting => {
|
|
$(`#${setting}-label`).click(() => {
|
|
let checked = $(`#${setting}`).prop("checked");
|
|
store.set(setting, checked);
|
|
|
|
if (setting == "startup") {
|
|
disabledArea();
|
|
}
|
|
});
|
|
|
|
$(`#${setting}`).prop("checked", store.get(setting));
|
|
});
|
|
|
|
function disabledArea() {
|
|
if (store.get('startup')) {
|
|
$(".startup-min").removeClass("disabled-item");
|
|
}
|
|
else {
|
|
$(".startup-min").addClass("disabled-item");
|
|
$("#startup-min").prop("checked", false);
|
|
store.set("startup-min", false);
|
|
}
|
|
}
|
|
|
|
disabledArea(); |