mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #859 from Pax1601/858-export-to-file-files-nothing-happens-when-the-button-is-clicked
Fixed checkbox not working in export screen
This commit is contained in:
@@ -468,6 +468,7 @@ export function createCheckboxOption(text: string, description: string, checked:
|
|||||||
"disabled": false,
|
"disabled": false,
|
||||||
"name": "",
|
"name": "",
|
||||||
"readOnly": false,
|
"readOnly": false,
|
||||||
|
"value": null,
|
||||||
...options
|
...options
|
||||||
};
|
};
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
@@ -476,10 +477,11 @@ export function createCheckboxOption(text: string, description: string, checked:
|
|||||||
label.title = description;
|
label.title = description;
|
||||||
var input = document.createElement("input");
|
var input = document.createElement("input");
|
||||||
input.type = "checkbox";
|
input.type = "checkbox";
|
||||||
input.checked = checked;
|
input.checked = checked;
|
||||||
input.name = options.name;
|
input.name = options.name;
|
||||||
input.disabled = options.disabled;
|
input.disabled = options.disabled;
|
||||||
input.readOnly = options.readOnly;
|
input.readOnly = options.readOnly;
|
||||||
|
input.value = options.value;
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
span.innerText = text;
|
span.innerText = text;
|
||||||
label.appendChild(input);
|
label.appendChild(input);
|
||||||
|
|||||||
@@ -31,10 +31,11 @@ export abstract class UnitDataFile {
|
|||||||
headersHTML += `<th data-coalition="${coalition}">${coalition[0].toUpperCase() + coalition.substring(1)}</th>`;
|
headersHTML += `<th data-coalition="${coalition}">${coalition[0].toUpperCase() + coalition.substring(1)}</th>`;
|
||||||
|
|
||||||
const optionIsValid = this.data[category].hasOwnProperty(coalition);
|
const optionIsValid = this.data[category].hasOwnProperty(coalition);
|
||||||
let checkboxHTML = createCheckboxOption(`${category}:${coalition}`, category, optionIsValid, () => { }, {
|
let checkboxHTML = createCheckboxOption(``, category, optionIsValid, () => { }, {
|
||||||
"disabled": !optionIsValid,
|
"disabled": !optionIsValid,
|
||||||
"name": "category-coalition-selection",
|
"name": "category-coalition-selection",
|
||||||
"readOnly": !optionIsValid
|
"readOnly": !optionIsValid,
|
||||||
|
"value" : `${category}:${coalition}`
|
||||||
}).outerHTML;
|
}).outerHTML;
|
||||||
|
|
||||||
if (optionIsValid)
|
if (optionIsValid)
|
||||||
|
|||||||
Reference in New Issue
Block a user