mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-08-07 07:16:13 +00:00
Merge pull request #1577 from linuxserver/fix/checkbox-test-config
Fix checkbox config values always returning "1" in Test config
This commit is contained in:
Vendored
+6
-1
@@ -4271,7 +4271,12 @@ $.when($.ready).then(function () {
|
||||
data.url = apiurl;
|
||||
$(".config-item").each(function () {
|
||||
var config = $(this).data("config");
|
||||
data[config] = $(this).val();
|
||||
// For checkboxes, use checked state instead of value attribute
|
||||
if ($(this).is(":checkbox")) {
|
||||
data[config] = $(this).is(":checked") ? "1" : "0";
|
||||
} else {
|
||||
data[config] = $(this).val();
|
||||
}
|
||||
});
|
||||
data.id = $("form[data-item-id]").data("item-id");
|
||||
if (data.password && data.password === fakePassword) {
|
||||
|
||||
@@ -310,7 +310,12 @@ $.when($.ready).then(() => {
|
||||
data.url = apiurl;
|
||||
$(".config-item").each(function () {
|
||||
const config = $(this).data("config");
|
||||
data[config] = $(this).val();
|
||||
// For checkboxes, use checked state instead of value attribute
|
||||
if ($(this).is(":checkbox")) {
|
||||
data[config] = $(this).is(":checked") ? "1" : "0";
|
||||
} else {
|
||||
data[config] = $(this).val();
|
||||
}
|
||||
});
|
||||
|
||||
data.id = $("form[data-item-id]").data("item-id");
|
||||
|
||||
Reference in New Issue
Block a user